ID: 38007 Updated by: [EMAIL PROTECTED] 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] [EMAIL PROTECTED] 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