Nunners Posted February 3, 2009 Share Posted February 3, 2009 I've setup an automated script that thens selects some other scripts to run depending on day, time (which I would have done on a cron but it needs other info dependant on whether work is open or not!) however I've hit a problem. The following.... <?php $cron["script"]="/cronjobs/db_tidy.hourly.php"; $return = exec("/usr/bin/php /var/www/vhosts/website/httpsdocs".$cron["script"], $return_var); ?> Produces.... sh: /php: No such file or directory If I call the script from the command line it works fine, however from using either exec or system calls from within php, it doesn't. Can anyone shed any light on why it might be happening? Thanks Nunners Link to comment https://forums.phpfreaks.com/topic/143595-execsystem-problems/ Share on other sites More sharing options...
justinh Posted February 3, 2009 Share Posted February 3, 2009 you have a space after php, not sure if this matters or not. Link to comment https://forums.phpfreaks.com/topic/143595-execsystem-problems/#findComment-753438 Share on other sites More sharing options...
Nunners Posted February 3, 2009 Author Share Posted February 3, 2009 you have a space after php, not sure if this matters or not. It's just like calling php from the command line. So /usr/bin/php is the call to php, and then /var/www etc. is the file for php to run... Link to comment https://forums.phpfreaks.com/topic/143595-execsystem-problems/#findComment-753442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.