Can't i run php scripts with a crontab?


#1

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?

http://shareminer.com


#2

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.

-Scott


#3

http://wiki.dreamhost.com/index.php/Cron#Executing_a_PHP_Script_with_Crontabs

http://teamshocker.com


#4

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?

http://shareminer.com


#5

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).

–rlparker