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
2
votes
1 answer

PHP Imagemagick - passthru not working when trying to output a image without saving to the local folder

In the below code , iam trying to output a image through imagemagick processing. Here, iam applying a border radius to the input image. I am getting the output when iam saving a image to the output folder with the following code.
RaviSankar
  • 31
  • 1
  • 2
2
votes
1 answer

ImageMagick is installed, but php extension of Imagick is not enabled

Hy there, I have a shared hosting account. They installed Image Magick on my request. But I get this error. PHP Fatal error: Class 'Imagick' not found in /home/hamrohos/public_html/test.php on line 6 I told them what was wrong. They replied…
sandipkc7
  • 21
  • 3
2
votes
1 answer

Executing tcl script inside php

I am trying to execute tcl script inside php using passthru function. TCL script perfectly executes on the normal unix terminal. Whereas in php its not giving expected results on the browser. I am passing the environment variable using passthru…
1
vote
2 answers

passthru() + Pipe in subprocess = Traceback (most recent call last): (…) in stdout=subprocess.PIPE)

I've got an error when I'm using passthru() to call a python script (using subprocess and pipe) with PHP. Here is the error: Traceback (most recent call last): File "…/Desktop/h.py", line 11, in stdout=subprocess.PIPE) #set up the convert…
Zorkzyd
  • 929
  • 3
  • 12
  • 30
1
vote
1 answer

MS Access cancel execution of pass-thru query keyboard shortcut

When using SQL pass-thru queries in MS Access, there is a default time-out of 60 seconds, at which point an instruction is sent to the remote server to cancel the request. Is there anyway to send this command from the keyboard similar to Access' own…
Matt Donnan
  • 4,933
  • 3
  • 20
  • 32
1
vote
3 answers

PHP command not executed system(), exec() or passthru()

I am trying to run a command line file conversion using open office. openoffice pdf filename.doc 2>&1 when i execute in command line as root it works fine and the file is converted. However when i pass the above command in a PHP file as apache…
user914425
  • 16,303
  • 4
  • 30
  • 41
1
vote
1 answer

Problem in using functions Exec, passthru, System

Hi all dear friends and teachers ... Heart In the design phase of my current project I'm wrong and I tried Game, unfortunately I missed a positive result. HuhHuh Project in the programming language I've been using AutoHotKey Autoit or better to say,…
Amir Gholami
  • 73
  • 1
  • 1
  • 6
1
vote
3 answers

performance of passthru("cat file")

I'm using passthru("cat filepath") in my download script. My concern is that it might use a lot of server resource. What is the difference between directly link a file in a public directory and download a file using passthru("cat filepath") in php?
Moon
  • 22,195
  • 68
  • 188
  • 269
1
vote
2 answers

php start php script and continue

At the moment I have a line of code like this: system("/usr/bin/php myphpscript.php --param=".val); Is there a way to make php not wait for the script to finish - and just move on instead? It's a loop moving email, and the myphpscript.php is…
jack
  • 1,317
  • 1
  • 14
  • 21
1
vote
0 answers

php nl2br not working with output of passthru and shell_exec

I have a program (written in cpp) which outputs some text lines. Each line starts on a new line. On the commandline this program works well. To test the code I used both fprintf (stdout, "some text\n"); and 'cout << "some text" << endl;' to produce…
iep
  • 601
  • 1
  • 8
  • 23
1
vote
1 answer

Using variable in php passthru

I would like to put my variables inside my passthru, $cut1 =DNAseq1 $cut2 = DNAseq2 I have already checked this topic but didn't find how to proceed echo passthru('sudo docker run my_docker bash -c "-check "' .$cut1.'" "'.$cut2); but nothing is…
1
vote
1 answer

(PHP) Live output proc_open

i have tried many time by using flush() to make the script work synchronously, the script prints only data of the first command "gcloud compute ssh yellow" and "ls -la", I am looking to make the script prints the output on every executed…
Ely
  • 13
  • 6
1
vote
1 answer

webservice reference shenanigans

I have a .net webservice (passthrough WS) that passes through to another one (underlying WS), passing a particular custom object. both WS's include the assembly with the particular custom object class in, but when i add the service reference to the…
nat
  • 2,185
  • 5
  • 32
  • 64
1
vote
2 answers

Mac OSX Convert library (html file to pdf) works via terminal but not PHP

I'm trying to take a generated html file and convert it to PDF on the fly with PHP. It's going on my localhost and staying there so for the PDF conversion I'm using a Mac OSX utility, I guess you would call it. The terminal command…
Jeff Andersen
  • 332
  • 8
  • 14
1
vote
1 answer

php passthru returns no output

I am trying to call a python script from php. However, I cannot figure out how to return the result to my php script in order to use it there. My php script is as follows:
Christian
  • 991
  • 2
  • 13
  • 25