Questions tagged [passthru]

PHP Function to execute an external program and display raw output.

void passthru ( string $command [, int &$return_var ] )

The passthru() function is similar to the function in that it executes a command. This function should be used in place of or when the output from the Unix command is binary data which needs to be passed directly back to the browser.

92 questions
0
votes
0 answers

Php/Python : executing python from php?

passthru('python directory_read.py < 5'); passthru('python directory_read.py < 1'); the first line of code works perfectly fine while the second line does'nt works? also directory_read.py reads the contents of a directory upto 5 or 1 depth i…
mobman
  • 89
  • 1
  • 8
0
votes
1 answer

PHP running a shell script to scp

I want to use PHP to run a shell script that sends a file from server 1 to server 2. I have the server 1 public key written to the server 2 authorized_keys and it works perfectly. For some reason the following script doesn't actually send the file…
John
  • 32,403
  • 80
  • 251
  • 422
0
votes
2 answers

PHP: passthru and register_shutdown_function

I am having strange issue. I have a script that causes download using passthru() - I want to record into database when user is downloading file... To do this, I have register_shutdown_function() before passthru but it gets called without file being…
Sohaib Shaheen
  • 324
  • 1
  • 5
  • 14
0
votes
3 answers

exec function in PHP and passthru?

Hello I have a couple questions about PHP exec() and passthru(). 1) I never used exec() in PHP but I have seen it is sometimes used with imagemagick. I am now curious, what is some other common uses where exec is good in a web…
JasonDavis
  • 48,204
  • 100
  • 318
  • 537
0
votes
1 answer

PHP and EXE files

When I searched for a way to execute a PHP script within another PHP script, I found the function passthru() at http://www.php.net/manual/de/function.passthru.php. I scrolled down and saw something with the registry, command line and EXE files. Is…
Cubi73
  • 1,891
  • 3
  • 31
  • 52
0
votes
1 answer

Calling a python script in Cakephp

I wrote a service class called search_categorization_service.php. Now I am making a call to python scrpt in this class class SearchCategorizationService { function searcher($query) { $tmp=passthru("python serverscript1.py $query"); …
0
votes
1 answer

Run perl when system() is disabled

I'm trying to run a Perl script using: $var = null; system(PATH_PERL . 'script.pl', $var); var_dump($var); However, I'm getting this error: Warning: system() has been disabled for security reasons [...] The complete list of disabled functions…
user1544337
0
votes
3 answers

exec() and passthru() php executing

I try to execute a python script with PHP But I got no results:I tried $tmp = passthru("C:\\Python27\\python.exe C:\\Python27\\script.py C:\\Python27\\file.pdf",$output); print($output) The results :"1" While $tmp = exec("C:\\Python27\\python.exe…
Alex
  • 97
  • 1
  • 4
  • 15
0
votes
1 answer

Get certain information from passthru and top

I have tried to use this possible solution without any luck: $test = passthru('/usr/bin/top -b -n 1'); preg_match('([0-9]+ total)', $test, $matches); var_dump($matches); That code shows the following text: top - 19:15:43 up 31 days, 23 min, 1 user,…
Airikr
  • 6,258
  • 15
  • 59
  • 110
0
votes
2 answers

MATLAB output to PHP code

I want to pass MATLAB output to my php code. My MATLAB code, I have: function x = returnX() x = 100; end And my PHP code:
user2168
  • 309
  • 8
  • 15
0
votes
2 answers

DDK sample passthru not loaded in win7

I am developing a driver based on ddk sample "passthru" and I have trouble loading this driver in win7(x86 or x64). I have tested my driver in winxp (x86 and x64), and it works pretty well, but when I tried to load this driver into win7 (F8->Disable…
Jeff Zhou
  • 9
  • 3
0
votes
2 answers

1:1 call PHP from Python

We're using Splunk (A tool to analyse machine data like log files) and have an application in PHP. For some data we need to do a call to our application in php (CLI-based). Unfortunately Splunk only supports Python calls. Is there an easy way to 1:1…
0
votes
1 answer

SSO error for some users in alfresco

We have two nodes in a clustered enviornment (Alfresco and tomcat) with passthru authentication along with ldap and NTLM configured. protocol order is TCPIP, NETBIOS. It works fine most of the time, but sometimes and for some users authentication…
0
votes
1 answer

Getting html into the pdf file when output with passthru

I get an error when trying to display my pdf in a popup window. This may be caused when I do a passthru. My browser is Firefox(14.0.1). I generate a pdf on the serverside that I want to show in a browser popup. I create the pdf and set a header(…
Gabriel
  • 464
  • 1
  • 5
  • 17
-1
votes
1 answer

How to properly "passthrough" a CLI program to a PHP script *while executing your own function*? (My old method has broken.)

Up until a few days ago, I had this working. It had been working for a long time. I'm not sure if it was because of upgrading PHP 8.0.12 to 8.0.13, or because yt-dlp updated and has changed something since. I have not changed my code. This…
user17535142
  • 71
  • 1
  • 6