cron job running PHP script to update MySQL - access denied error
I have a cronjob set up to run every 5 minutes and all it does is run a PHP script and updates a MySQL database. I am getting this error.
/bin/sh: /usr/bin/curl: Permission denied The directory permissions are drwxr-xr-x File permissions are set to -rwxr-xr-x I have tried these in for the cronjob */5 * * * * curl /public_html/directory/cron_fivemins.php or */5 * * * * curl http://www.url.com/cron_fivemins.php If I run the script manually it works fine, so I am assuming it is a permissions issue. Any help is appeciated. Thanks |
Would you copy and paste the precise line which is failing in your crontab file?
|
Quote:
|
Post the contents of your script and also the results of
ll /usr/bin/curl |
I found some information on this and tried the following in my cron tab:
*/5 * * * * /usr/local/bin/php /usr/home/username/public_html/directory/cron_fivemins.php Now I get an error that says: no input file found. Am I on the right track? Thanks |
Difficult to say without looking at your PHP code. /usr/local/bin/php is for running php scripts via the command line. Does the script run from the command line i.e.
php cron_fivemins.php? You might need to modify your script somewhat to run via CLI. |
When I've had this type of error (it runs for me but not for cron) it's normally a permissions issue. What crontab file are you running from? ie: when you modify crontab what is your user ID?
|
Quote:
|
I found this article and followed the info in it, but still no luck. I also just found out that my hosting does not allow crons under 15 minutes, and I was trying 5. So I am just testing it now with 20 minutes.
http://www.modwest.com/help/kb5-125.html Working now. Never even thought of something like that from my hosting service. It was just by chance I checked with them. Thanks for the answers. |
You need a better provider...
|
All times are GMT -5. The time now is 11:46 AM. |