Drupal: How to cron with 000webhost? -
06-06-2008, 05:29 PM
Has anyone figured out the right Cron command that works on 000webhost in order to run the cron maintenance tasks with Drupal 6? I'm trying to use the cPanel, and none of my efforts seem to do anything... Thanks.
When the system runs your cron jobs, the current directory is /home/axxxxxxx/ rather than /home/axxxxxxx/public_html. The cron.php program will refuse to work because it can't find necessary .inc files. Adding a chdir command to switch to public_html directory in cron.php will solve this problem. Here's an example:
OK, I can handle that. But am I okay running the cron.php file directly via a cron job (e.g., just adding "public_html/cron.php" to the cron command)? This seems to be the only command that 000webhost lets me run. The Drupal help documents specifically frown on that behavior, stating that I should be using wget or lynx to access the cron.php from a browser. That was the original intent of my question.
I have also had issues with drupal and cron on 000webhost. I added the chdir line to the cron.php file and I couldn't get it to work. I had set the cron job to run every 5 minutes but it never worked. For the command i put in public_html/cron.php
Nothing worked. I even tried it without the chdir command in the cron.php file and that didn't fix it either. Before I sumbit a ticket I would like to know if I am doing something wrong. Anyone have any suggestions?