Edit report at https://bugs.php.net/bug.php?id=63731&edit=1
ID: 63731 Updated by: ras...@php.net Reported by: scott at smashcat dot org Summary: shell_exec() cannot run some commands -Status: Open +Status: Not a bug Type: Bug Package: *General Issues Operating System: Linux PHP Version: 5.4.9 Block user comment: N Private report: N New Comment: Sorry, this has nothing to do with PHP. All PHP does is call popen() here which creates a pipe and forks a shell to run the command. To debug it try switching to your web server user id from the command line and trying it and if you are really stuck write a little popen() wrapper in C and try to figure out where it is failing. My guess is that it is a permissions issue. Previous Comments: ------------------------------------------------------------------------ [2012-12-08 23:37:17] scott at smashcat dot org Description: ------------ When attempting to call the zip command from php, it silently fails. Other commands to create and delete files etc work fine. Using correct path to zip etc. No errors, just fails. Running same command from terminal works. Test script: --------------- $zip=`which zip`; $res=shell_exec("$zip test.zip test.txt"); Expected result: ---------------- zip file should be created Actual result: -------------- Nothing. No errors, although the response variable $res contains what appears to be part of the zip file data. Seems like the output from zip is not going to the file, but being sent to the virtual terminal. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63731&edit=1