Cron & PHP

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
ashonline
Forum Newbie
Posts: 4
Joined: Sat Nov 05, 2005 5:15 pm

Cron & PHP

Post 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
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
Post Reply