How do I start a Cronjob with Cpanel/WHM?

Bigzed

Registered
Feb 19, 2005
3
0
151
Hey Guys,
I'm using Cpanel and I'm trying to run a PHP Script but it's not working.
It worked when I put "lynx --dumb" in front of the Path but my Provider told me thats not allowed.
So what should I do?
What Do I have to put in front of the Path/URL of the script?

Thanks,
Bigzed.
 

jester.ro

Well-Known Member
PartnerNOC
Feb 6, 2004
303
0
166
Bucharest, Romania
cPanel Access Level
DataCenter Provider
if you just want to run a php script, this is the best way:


/usr/local/bin/php -f /home/your_username/path/script.php

(make sure the php binary is there, ask you host for the location)

i would recommend against having the php script in your public_html, because sometimes crons are used to do some maintanace on a database for example, and allowing others to run the maintanance script at other times would be bad