Page 1 of 1

Cron & PHP

Posted: Tue Dec 20, 2005 9:02 pm
by ashonline
Hi

I have a simple PHP script which, when ran manually from the command line, will write entries into a text log file.

When this script is ran via a cron job however, the log file doesn't get written to, but the rest of the script works fine.

The crontab entry is:
1-60/5 * * * * php /root/script.php

The permisions on the script & log files are:
-rwxrwxrwx 1 root root 0 Dec 21 12:47 log.log
-rwxr-xr-x 1 root root 1358 Dec 21 13:13 script.php

The cron job is ran by the root user.

Can someone please help me with this one?

Thanks

Ashley

Posted: Wed Dec 21, 2005 1:50 pm
by timvw
Does root know that path to php? Otherwise, type it completely in your cron file, this way it always works ;)

eg: /usr/bin/php