I want to call a script on my server by opening a url. The script takes a long time to execute, so I want to run it in the background so there is no need to keep the browser open and worry about timeouts.
It looks like the PHP function system() should work, but it isn't working for me.
The script must execute from within the correct directory so that all relative paths are correct. Here is the system command I would like to execute:
cd /path/to/script/directory/;php my_php_script &
And this is the latest thing I've tried to no avail.
system('(cd /path/to/script/directory/;php my_php_script & > /dev/null)');
Anyone know how to do this?