Shell_exec () - Error executing PHP script

When I try to execute a PHP script using shell_exec() , it does not work.

The error_log file shows:

PHP Warning: shell_exec () [function.shell-exec]: cannot execute 'php / home / snabbsam / public_html / .....

System
Centos

shell_exec works with clamscan
shell_exec() working on the clamscan() function of clamav.
But it does not execute a PHP script

Things I checked:

  • PHP safe_mode disabled
  • shell_exec() not in disable_functions in php.ini
  • Tried to provide executable permissions on the file and parent folders, as suggested in https://stackoverflow.com/a/212985/ ...
+4
source share
1 answer

Try adding the full path to where the executable for php is located in your shell_exec call, just in case it is in a directory that is not accessible by default for the web server user.

+5
source

All Articles