For the script location, you can use the absolute path or relative to the current working directory of the php script. You can find this with:
$dir = getcwd();
echo "$dir\n";
To exec() in the background you will want to redirect stdout and stderr to /dev/null and exec in the background with "&".
See this thread:
http://www.phpbuilder.com/
Specifically:
exec('bash -c "exec nohup setsid your_command > /dev/null 2>&1 &"');
That will exec() in the background without blocking.
Make sure permissions on the perl script are executable by the user your web server is running cgi scripts as, as well as any directories or files your perl script accesses.
Main Topics
Browse All Topics





by: adrian_brooksPosted on 2009-10-30 at 11:27:18ID: 25705618
I would suggest putting the perl script into your cgi-bin directory. Give it the same permissions that your Apache web server has, but without world write access...i.e. 755...then when the perl script is finished doing whatever it has to do, have it make a call to a PHP script using the PHP CLI. If the PHP script should retain or hold data returned from the perl script, perhaps you could either write the values to a session or a database table and retrieve them from your web scripts.
Just a thought.
~A~