Another Cron Question

[ego]mouse

Verified User
Joined
Apr 1, 2005
Messages
14
Location
Wales, UK
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?
 
When you try to run PHP through CRON you need to do 2 things...

1) Edit your script and place
Code:
#!/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:
Code:
/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
 
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
 
Back
Top