Click to See Complete Forum and Search --> : Can't use '>' in exec() under XP


Anon
12-12-2001, 05:46 PM
Hello,

First of all: i'm using PHP 4.0.6 with Apache 2.0 under Windows XP.

My problem:
exec() doesn't work with a command containing the ">" redirection.

For exemple this code works ($status returned is '0', which is good):
..
$pouet = "jpegtopnm.exe miam.jpg";
exec($pouet, $results, $status);
..

But this one dooesn't(no output file created, and the $status retreived is 259, which seems to be bad):
..
$pouet = "jpegtopnm.exe miam.jpg > output";
exec($pouet, $results, $status);
..

If i run the command "jpegtopnm.exe miam.jpg > output" directly with a shell, of course it works.

I can't use the $result array, because jpegtopnm.exe produces binary data.

Thanx for any help...

Aymerick Jéhanne

ame12
12-12-2001, 11:48 PM
Since you're not specifying any full paths, would recommend you specify the full path and file name. XP might be like NT in that it runs these commands out of some system path.

Dave

================================================
BadBlue - the easiest PHP web server for Windows
http://badblue.com/helpphp.htm
================================================