Can't i run php scripts with a crontab?

I got an error mesage on my email.

“php: comand not found”

what da heck… it works without any problem on the cli.

can somebody help?

Use full paths in cronjobs. Like:
12 * * * * /usr/bin/php ~/bin/myscript.php

I’m guessing at the php path, but it also depends on if you want php4 or php5. Do a ‘which php’ to get the full path, then test your script manually using full paths.


so, i need to define the full path to my php binary… i see… i will try that.

btw, i take the chance to get an answer to another question…
how do i run php5 scripts on the cli? i guess defining the full path should do it… but where is the php5 interpreter?

You can always ask another question, but is usually better to put it in it’s own thread so others can find it easier :wink:

/dh/cgi-system/php5.cgi (from the Dreamhost wiki).