ohdang888 Posted May 6, 2009 Share Posted May 6, 2009 i want to run a php file with cron. I'm using cPanel's cron standard viewer to craete it. My problem is with the file directory i've got this: /usr/local/bin/php -q http://mysite.com/testing/cron/cron_job.php its executing the command, but the directory is messed up..i'm getting this error emailed to me: Could not open input file: http://mysite.com/testing/cron/cron_job.php Any ideas? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/157092-major-problems-with-cron/ Share on other sites More sharing options...
allworknoplay Posted May 6, 2009 Share Posted May 6, 2009 I think you have to use the actual directory on your server, not the full URL... I could be wrong though, I've never used cron via cPanel, only through the command line since I have full access to my server.... Quote Link to comment https://forums.phpfreaks.com/topic/157092-major-problems-with-cron/#findComment-827531 Share on other sites More sharing options...
ohdang888 Posted May 6, 2009 Author Share Posted May 6, 2009 i had problems with doing just directory too Quote Link to comment https://forums.phpfreaks.com/topic/157092-major-problems-with-cron/#findComment-827534 Share on other sites More sharing options...
timmah1 Posted May 6, 2009 Share Posted May 6, 2009 On my cron jobs, this is the format I use php -q /home/**USERNAME**/public_html/testing/cron/cron_job.php Then on your cron_job.php page, this at the top #!/usr/local/bin/php -q Not this /usr/local/bin/php -q http://mysite.com/testing/cron/cron_job.php Quote Link to comment https://forums.phpfreaks.com/topic/157092-major-problems-with-cron/#findComment-827623 Share on other sites More sharing options...
ohdang888 Posted May 6, 2009 Author Share Posted May 6, 2009 this is what i am entering as the command: php -q /home/tcrush/public_html/cron/cron.php and its emailing me this error: No input file specified. Quote Link to comment https://forums.phpfreaks.com/topic/157092-major-problems-with-cron/#findComment-827940 Share on other sites More sharing options...
ohdang888 Posted May 7, 2009 Author Share Posted May 7, 2009 still getting the same error Quote Link to comment https://forums.phpfreaks.com/topic/157092-major-problems-with-cron/#findComment-828163 Share on other sites More sharing options...
ohdang888 Posted May 8, 2009 Author Share Posted May 8, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/157092-major-problems-with-cron/#findComment-829782 Share on other sites More sharing options...
allworknoplay Posted May 8, 2009 Share Posted May 8, 2009 Probably because your PHP isn't in your server variable environment. So you can either edit your BASH and include it or you have to include the full path of your PHP. So ex: /usr/local/php/bin/php -q /home/tcrush/public_html/cron/cron.php That should work for you. Quote Link to comment https://forums.phpfreaks.com/topic/157092-major-problems-with-cron/#findComment-829791 Share on other sites More sharing options...
ohdang888 Posted May 13, 2009 Author Share Posted May 13, 2009 nope.... now getting this: /bin/sh: /usr/local/php/bin/php: No such file or directory Quote Link to comment https://forums.phpfreaks.com/topic/157092-major-problems-with-cron/#findComment-832915 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.