PDA

View Full Version : Another Cron Question


[ego]mouse
10-07-2005, 07:49 AM
Have i set this up correctly?

In userlevel --> Cronjobs

in the command enter

/home/egomouse/domains/egomouse.net/private_html/test.php

in the minute box */2, the rest are *


Will this run my php page every 2 mins?

resolveit
10-07-2005, 11:54 AM
When you try to run PHP through CRON you need to do 2 things...

1) Edit your script and place

#!/usr/local/bin/php -c

as your first line of the script (make sure this is exactly as it is here, taking into account that the path to the PHP binary should be changed to suit your system)

2) Modify your cron-job to:

/usr/local/bin/php -c /home/egomouse/domains/egomouse.net/private_html/test.php


Once again make sure the path to PHP is correct for your system.

Regards,
Onno Vrijburg

jlasman
10-07-2005, 03:21 PM
Onno,

The shebang line (that's what it's called) shouldn't be necessary if you're going to call the script using php; it should only be necessary if you're going to call the script as it's scriptname.

Also, why is the "-c" required?

Thanks.

Jeff