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 :
- When I’m executing the very same command from the terminal (via SSH) it’s working fine.
- The
execcommand is enabled (I can execute any command without issue).
Any ideas?
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:instead.