Having trouble with exec function calling CGI program
| From: | Tony Frasketi | Date: | Fri, 10 Aug 2001 21:15:21 +0000 |
| Subject: | Having trouble with exec function calling CGI program | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-62220@lists.php.net to get a copy of this message | ||
Hello
I'm a newbie and having trouble with the EXEC function call from a PHP
script. EXEC seems to work ok for executing shell commands like 'ls -al'
etc.
but when I execute the following PHP web page code...
----------------------------------
$basedir = '/mnt/web/xxx/myplace';
$cdir = $basedir . '/cgibin';
$cmd = "cd $cdir;pwd;perl -w myscript.cgi";
echo "cmd: $cmd<br>";
$result = exec($cmd,$arr,$status);
echo "status: $status [$result]<br>";
----------------------------------
Note: myplace and myscript.cgi are made up names.
The cgi program has been chmod'ed to 755 so it can run from a webpage
and
the cgi program runs fine when not called from the PHP script.
I get a status code of 155. Can someone please explain what this error
code means!
Thanks in advance
Tony Frasketi