Having trouble with PHP exec function calling CGI program
| From: | Tony Frasketi | Date: | Mon, 13 Aug 2001 13:08:00 +0000 |
| Subject: | Having trouble with PHP exec function calling CGI program | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-62415@lists.php.net to get a copy of this message | ||
Hello list members
I'm a newbie and having trouble with the EXEC function call from a PHP
script. I've submitted this problem to the list last week but so far no
response. And I still haven't figured it out. So here goes again.
PHP EXEC function 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>";
----------------------------------
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