PHP exec to run cron file
Posted: Tue Jun 23, 2009 3:36 pm
Hello,
I have a video conversion php file which runs via cron to execute a video conversion queue. Works perfectly when run with via cron, or executed directly from browser. For obvious reasons, the cron file is not accessible through the web, and is secured with htaccess.
I would like to give the administrator the ability to manually run the video conversion php cron file. I have attempted the code:
which is included in a php file which would be executed through an ajax call.
When the php file is executed in this manner, it does not appear to exit and continuously consumes system memory without accomplishing its mission.. Calling the file via cron works perfectly, why the memory leak when calling with php exec?
Thanks for any feedback, I must be missing something..
Also can not simply "include" the file, as it is called from a function which is initiated via AJAX.
The command "php -q /home/me/public_html/cronfile.php" works fine when executed from the shell, am only receiving memory leak when run with php exec.
I have a video conversion php file which runs via cron to execute a video conversion queue. Works perfectly when run with via cron, or executed directly from browser. For obvious reasons, the cron file is not accessible through the web, and is secured with htaccess.
I would like to give the administrator the ability to manually run the video conversion php cron file. I have attempted the code:
Code: Select all
exec("php -q /home/me/public_html/cronfile.php");When the php file is executed in this manner, it does not appear to exit and continuously consumes system memory without accomplishing its mission.. Calling the file via cron works perfectly, why the memory leak when calling with php exec?
Thanks for any feedback, I must be missing something..
Also can not simply "include" the file, as it is called from a function which is initiated via AJAX.
The command "php -q /home/me/public_html/cronfile.php" works fine when executed from the shell, am only receiving memory leak when run with php exec.