Page 1 of 1

executing commands with pipe operator in safe mode

Posted: Thu Jul 10, 2003 9:24 pm
by mrhelton
hi i can't seem to get php 4.2.2 to execute commands with the pipe operator in safe mode. i am issuing this command

passthru("jpegtopnm picture.jpg | pnmscale .5 | pnmtojpeg >picture_small.jpg");

i can't seem to get php to pipe the output of one command to the other.

also, the > doesn't work...for instance

passthru("jpegtopnm picture.jpg > picture.pnm");

however,

passthru("jpegtopnm picture.jpg");

does write the pnm binary text to the screen.

someone please help me out.

i also have jpegtopnm, pnmtojpeg, and pnmscale in my safe mode exec dir.

helton

Posted: Fri Jul 11, 2003 12:14 am
by mrhelton
? :(

Posted: Fri Jul 11, 2003 5:44 am
by Tubbietoeter
try system() or shell_exec()

Posted: Sun Jul 13, 2003 10:48 am
by cactus
What error messages are you recieving ?

Are those apps/binaries installed on your server/machine ? Are you able to run those commands from the command line ?

Regards,

Posted: Sun Jul 13, 2003 10:59 am
by Jabol
If you're using safe mode you cannot use any commands, not only the pipe ones.

Posted: Sun Jul 13, 2003 12:22 pm
by mrhelton
yes i am able to run these commands from the command line.

i'm not receiving any error messages, i'm just not getting a response.

in order to use redirection operators do you need to have a shell running? when i run 'ps' from a php script it shows that there are no processes running. (i put 'ps' in my safe mode exec dir)

helton