I've had this website running on Drupal for a couple of years, I never used cron before as I never understood its purpose. But in the 12 months I have come to know all the benefits of running cron jobs... However, I just cannot seem to make cron run automatically through my "Cirtex Hosting" control panel.
Cron runs fine if I goto: www.mywebsite.com/cron.php
However it does not run from CPanel's Cron Jobs.
GET and WGET are not allowed by my host, they said the following command will run fine:
/usr/local/bin/php -q /home/username/public_html/website/cron.php
But it doesn't, I just get emails every time it runs saying:
Warning: include_once(./includes/bootstrap.inc): failed to open stream: No such file or directory in /home/username/public_html/website/cron.php on line 9
Warning: include_once(): Failed opening './includes/bootstrap.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/username/public_html/website/cron.php on line 9
Fatal error: Call to undefined function drupal_bootstrap() in /home/username/public_html/website/cron.php on line 10I also tried running the following command:
/usr/local/bin/php -q http://www.mywebsite.com/cron.php
but receive an email stating:
Could not open input file: http://www.mywebsite.com/cron.php
I hope someone out there knows what's going wrong! Thank you so much!
Comments
.
What is going wrong is probably the current working directory which is used when you run command-line php. Drupal expects the current working directory to be ~public_html/website and uses "./" paths relative to that.
You could try to hack your cron.php file and add a
chdir("/home/username/public_html/website");line before the "include_once" line.But better check for other options except wget mentioned in http://drupal.org/cron, for example try
curl --silent --compressed http://www.cordiafreaks.com/cron.phpor
/usr/bin/lynx -source http://www.cordiafreaks.com/cron.phpor just tell them that running php command-line does not work and you need a browser command. It happened to me once on some host and they gave me access to wget.
thank you I'll give those two
thank you I'll give those two a go and see what happens... Otherwise I'll see about the browser command!
Cheers for that... I'll let you know how it goes
hey that first command you
hey that first command you mentioned actually seems to work!
curl --silent --compressed http://www.cordiafreaks.com/cron.php
I'll monitor it for the next hour and see if it keeps running! Looking good though!
Thanks heaps!!!
My cron has stopped
My cron has stopped working... It worked fine for about 4 days and just stopped without warning, I can still manually run cron, but that doesn't encourage the CPanel to let cron run...
I'm using:
curl --silent --compressed http://www.cordiafreaks.com/cron.php
Why did it stop? Thanks! :)
.
How often had you set it to run? (as you have specified it before the curl command).
When was the last run, as reported in the admin/reports/status page? Is that a longer time than the interval that you have specified? Also check the admin/reports page to see if there are any cron runs reported.
There is possibility that your host cancelled you access to curl. Not sure that is what happened, but anyway try the other commands mentioned in http://drupal.org/cron (lynx and wget).