stix Posted June 30, 2005 Posted June 30, 2005 (edited) Hi I have searched the forums exstensively and tried all the alternatatives offered on cron tab and running a script ! I am trying to run a php file that does maintanence for my ad server ! I used to be in a shared enviroment and it worked fine ! I have since moved to a dedicated server to no joy ! Is there something i need to activate on the WHM panel to allow cron to run on the server or am i missing something ? The script is related to php adserver maintanence ! I have tried GET http://www.XXXXXXX/file.php to no avail Tried it with a path to the file I am way confused !!!! Any help appreciated ! Edited June 30, 2005 by stix Quote
Ayman Posted June 30, 2005 Posted June 30, 2005 There are many ways to do it, I use: >wget -q -O - http://example.com/file.php HTH Quote
TCH-Bruce Posted June 30, 2005 Posted June 30, 2005 Or >php -q /home/cpanelname/public_html/path-to-php-file Quote
stix Posted June 30, 2005 Author Posted June 30, 2005 Thanks for the replies ! okay - i tried both ! Neither worked ? I have checked the permission on the file - 755 I have doubled checked the file path Any further suggestions ? Quote
TweezerMan Posted June 30, 2005 Posted June 30, 2005 Welcome to the forums, stix! How did you set up the time for the cron job to run? Quote
stix Posted June 30, 2005 Author Posted June 30, 2005 Welcome to the forums, stix! How did you set up the time for the cron job to run? <{POST_SNAPBACK}> Thanks David ! I set the time to run every minute mainly just to check i could get it working ! I was plannning to set it back to once an hour as pre the requirements of the software ! i tried in both both standard and advanced ! Quote
TCH-Bruce Posted June 30, 2005 Posted June 30, 2005 I use the following and it works. >/usr/bin/php -q /home/cpanelname/public_html/path-to-php-file Note that I added /usr/bin to the code, not that it should matter though. And replace cpanelname with your actual login name for cpanel. Have you checked your error log file? Quote
stix Posted June 30, 2005 Author Posted June 30, 2005 (edited) I use the following and it works. >/usr/bin/php -q /home/cpanelname/public_html/path-to-php-file Note that I added /usr/bin to the code, not that it should matter though. And replace cpanelname with your actual login name for cpanel. Have you checked your error log file? <{POST_SNAPBACK}> Still no joy ..... I looked in the error log file in the cpanel - and there is nothing related to the file i am trying to call Dam ! As i mentioned earlier - when i was in the shared enviroment i had no problems calling it with an http://XXX.com/pathtofile.php Edited June 30, 2005 by stix Quote
TweezerMan Posted June 30, 2005 Posted June 30, 2005 I looked in the error log file in the cpanel - and there is nothing related to the file i am trying to call <{POST_SNAPBACK}> I don't know that you'd see errors from your script in the error log. Usually, errors that occur in a cron job are e-mailed to you. You did enter an e-mail address in the "Please enter an email address where the cron output will be sent:" box on the Cron Jobs page in CPanel, right? Have you checked your e-mail to see if you've received a ton of e-mails from cron by now? As i mentioned earlier - when i was in the shared enviroment i had no problems calling it with an http://XXX.com/pathtofile.php <{POST_SNAPBACK}> You can't call a php script like that in a cron job, shared hosting or not. Are you sure the script is working on your new server (can you call it successfully in your browser)? What is the cron job command that you're currently trying to use? Quote
stix Posted June 30, 2005 Author Posted June 30, 2005 Hi I used both examples provided further up the thread - inserting the correct values ! I filled in the email - i am not recieving anything ! previously i used wget and i tried running to no joy ! I am trying to run the maintance script for phpadserver ! I keep running throu' the options, thanks for the replies ! Stu Quote
TCH-Bruce Posted June 30, 2005 Posted June 30, 2005 As David suggested, have you tried running the php file in your browser and does it work? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.