![]() |
CRON JOB gurus what is wrong with this ??
One of the scripts I purchased wants me to set a cron job as follows
0 * * * * php "path to your website dir"/cron.php So I set it up like this in Cpanel on a shared hosting account in the Advanced (Unix Style) Minute Hour Day Month Weekday Command 0 * * * * /home/username/public_html/cron.php I keep getting emails saying this /bin/sh: /home/usermname/public_html/cron.php: Permission denied Does this mean that the cron job is not being done or being denied permissions or does it mean my email address is not acepting emails from the cron job If it is the cron job that is being denied should I change the file permissions on the cron.php or have I done something else wrong Thanks |
Not a guru by any means but maybe the file needs execute permissions.
|
make sure the path to php is right
|
or there's in error in the path
|
change file permision so that user that is running that cron command can execute the file
(make the file executable for it's owner) |
Not sure about cPanel, but with DirectAdmin you use the URL, so public_html would not be in the path.
|
{PATH TO PHP} is usual /usr/local/bin/php
{PATH TO PHP} /home/******/public_html/cron.php |
If you set it up like this:
/home/username/public_html/cron.php try this way instead (adding php and a space): php /home/username/public_html/cron.php If you just use /home/username/public_html/cron.php, the system will try to execute it as a shell script, I think, which causes the above error. |
You forgot to put "php" in front of the file you wanted to run.
|
Quote:
0 * * * * php "path to your website dir"/cron.php It has the "php" with a space in front thanks :thumbsup |
Quote:
if that doesn't work, try full path to php /usr/bin/php or /usr/local/bin/php |
Quote:
thanks guys for the help :thumbsup |
Quote:
|
GFY CAN be a beautiful thing - problem solved in 20 mins, nice.
|
Quote:
I have asked for help a number of times on GFY and people on here have always helped Thanks GFY and all the peeps that have helped me over the last 2 years :thumbsup |
needs path to php...
example 0 * * * * /usr/bin/php -q /home/user/public_html/cron.php you can also use some other command such as get or wget 0 * * * * GET http://www.yoursite.com/cron.php 0 * * * * wget http://www.yoursite.com/cron.php |
make sure the php file has a shebang
|
Quote:
|
| All times are GMT -7. The time now is 02:17 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123