PDA

View Full Version : cron


Okolo
8th July 2004, 03:59 PM
What should the format for the cron job be?


What should it look like? I tried this but got the below error.

19 1 * * * /usr/bin/php -q /hsphere/local/home/wwwuser/nepsa.net/affiliate/scripts/recurring.php




Fatal error: Call to undefined function: mysql_connect() in /hsphere/local/home/wwwuser/nepsa.net/affiliate/adodb/drivers/adodb-mysql.inc.php on line 333

mark
8th July 2004, 10:29 PM
Hello,

the format for cron job is correct, and it executes the script properly because you
are able to see this error.
That error is caused by the fact that php somehow doesn't have access to mysql module
when you run it from command line.

The problem could be if you have installed Zend Optimizer, which might be working well
for apache web server, but can cause problems when running php scripts from
commandline.

You can overcome it by running script through webserver using wget (if you are on
linux):

wget http://www.yoursite.com/recurring.php -O /dev/null

instead of

/usr/bin/php -q /hsphere/local/home/wwwuser/nepsa.net/affiliate/scripts/recurring.php

hope it helped,

maros
http://www.webradev.com