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?
| SitePoint Sponsor |
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?
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.
Today I Just Found One Best Link for Cron Job May be its help you
http://adminschoice.com/crontab-quick-reference
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['SCRIPT_FILENAME']
Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.
is this one alright, thats what it looks like in Cpanel>cronjobSitepoint.jpg
But doesn't work, manually running the script does!
Please check the image attachment above, thats what my script looks like in Cpanel, please verify if its alright...
@xem I don't have more knowledge on Cron Job.......... I am born baby on this matter![]()
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.
cron.png
Bookmarks