Jump to content

major problems with cron


ohdang888

Recommended Posts

i want to run a php file with cron. I'm using cPanel's cron standard viewer to craete it.

 

 

My problem is with the file directory

 

i've got this:

/usr/local/bin/php -q http://mysite.com/testing/cron/cron_job.php

 

its executing the command, but the directory is messed up..i'm getting this error emailed to me:

 

Could not open input file: http://mysite.com/testing/cron/cron_job.php

 

Any ideas? Thanks.

Link to comment
Share on other sites

On my cron jobs, this is the format I use

 

php -q /home/**USERNAME**/public_html/testing/cron/cron_job.php

 

Then on your cron_job.php page, this at the top

#!/usr/local/bin/php -q 

 

Not this

/usr/local/bin/php -q http://mysite.com/testing/cron/cron_job.php

Link to comment
Share on other sites

Probably because your PHP isn't in your server variable environment. So you can either edit your BASH and include it or you have to include the full path of your PHP. So ex:

 

 

/usr/local/php/bin/php -q /home/tcrush/public_html/cron/cron.php

 

 

That should work for you.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.