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
1
vote
3 answers

Interacting with multiple servers over SSH in PHP

I'm currently writing a deployment framework in PHP. The framework connects to servers and executes commands over SSH. I've been looking for quite a while trying to find a way in PHP to do this better. Here are the requirements. The technique…
Cameron
  • 641
  • 1
  • 7
  • 18
1
vote
2 answers

Execution time vs idle time in PHP

This is more of a theoretical question. When I run a PHP script that does a passthru to some other program, say a Java application, let's assume that program works for 30 minutes and then ends gracefully and PHP keeps calling it in a loop every…
Frankie
  • 24,627
  • 10
  • 79
  • 121
1
vote
1 answer

IIS Proxy/pass through question

We have set of computers that need to access a certain web application (MVC) hosted on our ASP.NET box. These computers are on their own little subnet that can only see a small back office server that controls them. That server, in turn, can see the…
chrisjlong
  • 69
  • 2
  • 10
1
vote
1 answer

PHP functions - Security issues?

I have a question regarding the following PHP functions: exec() system() passthru() shell_exec() I've tried signing up with https://wpengine.com/ but their technical support informed me that they have disabled the four PHP functions on their…
user7599157
1
vote
1 answer

PHP passthru: unable to get full response from python script

I'm trying to get data from Python script: import pymorphy2 import json import sys morph = pymorphy2.MorphAnalyzer() butyavka = morph.parse(sys.argv[1])[0] for item in butyavka.lexeme: print(item.word) PHP…
Michael
  • 15
  • 3
1
vote
1 answer

PHP: Problem using passthru to stream a zip on mac os x only

I'm trying to put together a zip streaming solution through the use of Unix's zip command and PHP's passthru function, but I've hit a snag. The script looks something like this:
Julien P.
  • 79
  • 1
  • 10
1
vote
0 answers

sh: sqlldr: command not found php passthru(); but PATH in sysconfig/httpd/ seems to be ok

php passthru( 'echo $PATH >>/tmp/sqlldrproblem 2>&1' ); passthru( "sqlldr USERID=scott/tiger@dbhost control=/tmp/test.ctl log=/tmp/test.log >>/tmp/sqlldrproblem 2>&1" ); Oracle Linux7.1 # cat…
user3569065
  • 105
  • 1
  • 2
  • 8
1
vote
1 answer

PHP passthru with colorized output

I have a script that runs other scripts based either on a specified schedule or on demand depending on the command. This allows mundane and time consuming tasks to be managed in a central location as well as simplifying the management in general. …
Joseph
  • 1,988
  • 14
  • 21
1
vote
1 answer

Execute a binary string with a "Program execution Functions" (exec, system, etc ...)

Is it possible to execute a binary string with a "Program execution Functions" (exec, system, etc ...) ? http://php.net/manual/en/ref.exec.php For example, the following file is a php script with a binary "hello, world" program. It was originally…
Thom Thom Thom
  • 1,279
  • 1
  • 11
  • 21
1
vote
1 answer

Embedding Video Stream into webpage

This is a progress after the question Embedding Image/Video Stream into webpage that was answered for the picture only using curl, video is still an open issue. Resuming, I need to avoid that the visitor of a web page see the real source of an image…
Power Engineering
  • 713
  • 14
  • 26
1
vote
0 answers

Tell PHP to use MAMP PHP Binary

I am on Mac osx, using MAMP server. I am working on a php project that has a php script with a line similar to the following: passthru("php path/to/script.php"); This was causing some serious issues which I was able to rectify by hard-coding the…
LiveSource
  • 6,230
  • 4
  • 21
  • 20
1
vote
2 answers

using PHP shell_exec so that the output is "piped" not "dumped"

quick question really. Consider the following code: //__/var/test/cli_test.php__ $x = 0; while ($x < 9){ print "loop " . str_pad($x, 3, "0", STR_PAD_LEFT) . "\n"; sleep(1); $x++; } if I type php /var/test/cli_test.php in the command line I…
user26676
  • 280
  • 3
  • 21
1
vote
2 answers

MS Access Passthrough Query Update

I am trying to make an Update to a Passthrough query using MS Access to an ODBC server that I have no control over. The reason I have to use a Passthrough is that the records I am accessing have more than 255 fields (I would use a linked table if I…
reubenb87
  • 303
  • 4
  • 11
1
vote
1 answer

Continue execution after calling php passthru() function

When using php passthru() function, default is to stay until the external script execution ends. PHP manual says ::::: "If a program is started with this function, in order for it to continue running in the background, the output of the program…
EastSw
  • 927
  • 1
  • 9
  • 28
0
votes
1 answer

Why is calling (ImageMagick) convert.exe from PHP script resulting in an unresponsive page?

* This is now resolved * by clearing the temp folder in windows! Some info - Windows 2003 server, IIS 6 ImageMagick 6.3.3 PHP 5.2.0 I am using ImageMagick to resize images on the server and I think this has recently been causing problems. What I am…
undefined
  • 5,190
  • 11
  • 56
  • 90