I'm a "middlebie", and I have the same problem. From the archives, I found
suggestions from Richard Lynch:
Does it work perfectly from the command line if you su to "nobody" (or
whomever PHP runs as) before you execute it?
Is it world executable?
Does it access resources such as PGP key-rings that "nobody" can/cannot
Are you sure you have the path correct?
In my case, the answer is yes to all of the above (except for su'ing to
nobody since I
can't do that on this client's server). I've also discovered that it's
usually a path/permission
problem unless the server was built in 'safe mode' in which case, no script
can be called.
I added in `date`; to see if I could execute anything & nothing happened,
so I fear this.
Now all I need to do is read up on suid in the PHP manual. Thankfully,
this is just a tool
for the client, and not something the world will see.
Any other suggestions?
----- Original Message -----
From: "Tony Frasketi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 13, 2001 6:08 AM
Subject: [PHP] Having trouble with PHP exec function calling CGI program
> 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
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]