hey there; I'm trying to call a php script with shell_exec() or exec(), like so:
<?php
exec ('bash -c "exec nohup setsid /usr/bin/php script.php > /dev/null 2>&1 &"');
?> |
this should run the script.php file in the background, as a separate process.
I've also tried running this:
<?php
exec ("/usr/bin/php script.php");
?> |
but neither work - I get the following results (piped to a txt file):
Status: 404
Content-type: text/html
X-Powered-By: PHP/4.3.9
No input file specified. |
so PHP is being started, but it isn't seeing script.php (right?). I've tried relative and absolute paths to the script, tried using "-f", nothing.
does this have to do with /cgi-php/phpwrapper, or suexec? the fact that it's a shared environment? I found no problems in phpinfo()... but I know my script works on its own (run directly or included), and both approaches have worked in the past, on other servers/hosting co's.
any ideas? thanks!