#23092 [Bgs]: exec("foo.php") hangs
| From: | edink@php.net | Date: | Wed, 23 Apr 2003 09:36:01 +0000 |
| Subject: | #23092 [Bgs]: exec("foo.php") hangs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-38191@lists.php.net to get a copy of this message | ||
ID: 23092
Updated by: edink@php.net
Reported By: jlg at huelladigital dot net
Status: Bogus
Bug Type: Program Execution
Operating System: Redhat 7.3 (kernel 2.4.18)
PHP Version: 4.3.2-RC
New Comment:
Better yet make sure /usr/local/bin/php is CLI and not CGI version of
PHP. CGI cannot be executed from withing web server environment like
that.
Previous Comments:
------------------------------------------------------------------------
[2003-04-23 04:07:51] sniper@php.net
Remove those hasbang lines and it will work fine.
------------------------------------------------------------------------
[2003-04-08 02:46:22] jlg at huelladigital dot net
I did, with no result. I also tried the other execution functions:
passthru(), system(), shell_exec() and proc_open(). I tried, as well,
redirecting the output to /dev/null &. The result was always the same.
------------------------------------------------------------------------
[2003-04-07 17:56:03] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-04-07 10:06:08] jlg at huelladigital dot net
I have php compiled as cgi in /usr/local/bin/php:
./configure --with-mysql --enable-ftp --enable-sockets --with-ncurses
--enable-cgi
I have 2 scripts, named foo1 and foo2:
foo1:
#!/usr/local/bin/php
<?php
exec("./foo2");
?>
foo2:
#!/usr/local/bin/php
<?php
print "foo";
?>
When I call foo1 from shell the result is OK (it echoes "foo"). But
when I call it as a cgi (http://myserver/cgi-bin/foo1) it calls
recursively the script "foo2" and hangs. I must restart apache.
It is Apache/1.3.27.
The script directory cgi-bin has "Options ExecCGI" directive.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23092&edit=1