#38007 [Opn->Fbk]: system() does not work under apache
| From: | tony2001@php.net | Date: | Thu, 06 Jul 2006 20:39:00 +0000 |
| Subject: | #38007 [Opn->Fbk]: system() does not work under apache | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99177@lists.php.net to get a copy of this message | ||
ID: 38007
Updated by: tony2001@php.net
Reported By: marcus dot yu at rogers dot com
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: fedora core 5
PHP Version: 5.1.4
New Comment:
Did you enable SELinux ?
Previous Comments:
------------------------------------------------------------------------
[2006-07-05 01:49:07] judas dot iscariote at gmail dot com
return value : 2
current CVS, apache 2.2.2 on Linux.
------------------------------------------------------------------------
[2006-07-04 20:01:38] marcus dot yu at rogers dot com
yes. even use /bin/ls got the same result.
------------------------------------------------------------------------
[2006-07-04 19:42:34] iliaa@php.net
Is ls binary in the path?
------------------------------------------------------------------------
[2006-07-04 16:40:13] marcus dot yu at rogers dot com
Description:
------------
The function system() does not work in PHP 5.1.4 under Apache 2.2.0+ in
fedora core 5. The kernel is 2.6.17-1.2139_FC5. The return value is 127.
If runs as shell script, the function works. The safe mode is off. It
was tested on both Apache 2.2.0 and 2.2.2.
Reproduce code:
---------------
<?
$last_line = system ("ls -l", $return_value);
echo " return value : $return_value ";
?>
Expected result:
----------------
list all files in the working directory just as run 'ls -l' in command
line.
and the return value is 0.
Actual result:
--------------
nothing. the return value is 127.
In fact, if modified the code a little bit and run it as shell script,
it works.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38007&edit=1