I'm using an ajax call to execute shell_exec on the server (centos). The line that I'm executing is the followingecho shell_exec(php -q /websockets/timedactions.php);This is the server response:X-Powered-By: PHP/5.5.16Access-Control-Allow-Origin: http://myIpAddressAccess-Control-Allow-Credentials: trueContent-type: text/htmlAfter running this command it seems that the process that it supposed to activate is not running.Calling the same command on shell with root accessphp -q /websockets/timedactions.phpworks perfectly.How can I make the script work using shell_exec ?more info:ps aux | grep httpd | awk '{print $1}' = nobodysestatus|grep enforcing = {no result}file permissions -rwxr-xr-x 1 root root ls -lZ timedactions.php -rwxr-xr-x root root ? timedactions.php*
php - running shell command using shell_exec
php
Well ok thenSeems the answer was pretty easy (frustrating as it can be :-) )I just added the complete path to PHP.Dont really know why i didnt get any errors before and why it is working (if anyone can explain)shell_exec('/usr/local/bin/php -q /websockets/timedactions.php /dev/null 2>&1 &');Thank you for trying...