Reputation: 22810
I'm using exec to run a background script like this :
$command = "/usr/local/bin/php public_html/r/index.php tools $action process $params > /dev/null &";
exec($command);
The thing is : it's NOT working.
Hints :
exec
command is enabled (I can execute any command without issue).Any ideas?
Upvotes: 1
Views: 1962
Reputation: 360572
background jobs tend to have different 'current' directories than your shell - usually it's the home directory of the account that the job is running under. Unless your public_html is in /home/whoever
, you're not actually running your script. Try an absolute path:
$command = "/usr/local/bin/php /path/to/public_html/r/index.php etc..."
^^^^^^^^^
instead.
Upvotes: 6