xem — 2012-02-26T13:03:53-05:00 — #1
I have been trying to run a php script in the cronjob settings in my cpanel but failed.
I'm confused with the command line, can any one help with that please?
lawrence_wright — 2012-02-27T03:46:04-05:00 — #2
What script are you running? We can better answer your question if we knew.
Your cron job should look something like this.
php -q /home/CPANEL-USER/public_html/SCRIPT-DIRECTORY/cron.php
However, we can't say for sure as your script could require a special way of cron being called.
xem — 2012-02-27T08:14:32-05:00 — #3
its a php script, a with a mail function in it...will send emails when users register!
system — 2012-02-27T08:41:24-05:00 — #4
Today I Just Found One Best Link for Cron Job May be its help you
starlion — 2012-02-27T08:48:34-05:00 — #5
cPanel should provide you with enough prompts to get the timing correct.
the command to issue will be what Lawrence posted. php -q <filepath>
the filepath you can discover by echoing $SERVER['SCRIPTFILENAME']
xem — 2012-02-27T22:09:30-05:00 — #6
is this one alright, thats what it looks like in Cpanel>
But doesn't work, manually running the script does!
xem — 2012-02-27T22:11:09-05:00 — #7
Please check the image attachment above, thats what my script looks like in Cpanel, please verify if its alright...
xem — 2012-02-27T22:12:02-05:00 — #8
Please see above!!
system — 2012-02-28T00:37:45-05:00 — #9
@xem I don't have more knowledge on Cron Job.......... I am born baby on this matter :x
handyman103 — 2012-02-28T10:56:15-05:00 — #10
Upload your script, go to cpanel / cron and add as follows..
lynx -dump http://www.domain.com/script.php
This drops me an email to say that its done and I have One set to run everynight at midnight and one on the 1st and 15th of every month.