GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   CRON JOB gurus what is wrong with this ?? (https://gfy.com/showthread.php?t=927352)

halfpint 09-12-2009 02:39 PM

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

lazzlo 09-12-2009 02:45 PM

Not a guru by any means but maybe the file needs execute permissions.

brassmonkey 09-12-2009 02:47 PM

make sure the path to php is right

lazzlo 09-12-2009 02:49 PM

or there's in error in the path

greg80 09-12-2009 02:49 PM

change file permision so that user that is running that cron command can execute the file

(make the file executable for it's owner)

baddog 09-12-2009 02:49 PM

Not sure about cPanel, but with DirectAdmin you use the URL, so public_html would not be in the path.

brassmonkey 09-12-2009 02:49 PM

{PATH TO PHP} is usual /usr/local/bin/php

{PATH TO PHP} /home/******/public_html/cron.php

frank7799 09-12-2009 02:54 PM

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.

fuzebox 09-12-2009 02:55 PM

You forgot to put "php" in front of the file you wanted to run.

halfpint 09-12-2009 02:58 PM

Quote:

Originally Posted by m4yadult (Post 16311463)
If you set it up like this:

/home/username/public_html/cron.php

try this way insted (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 caused the above error.

ha I think thats the problem because the installation says set the cron up as this

0 * * * * php "path to your website dir"/cron.php

It has the "php" with a space in front


thanks :thumbsup

woj 09-12-2009 02:58 PM

Quote:

Originally Posted by fuzebox (Post 16311468)
You forgot to put "php" in front of the file you wanted to run.

:thumbsup
if that doesn't work, try full path to php /usr/bin/php or /usr/local/bin/php

halfpint 09-12-2009 02:59 PM

Quote:

Originally Posted by fuzebox (Post 16311468)
You forgot to put "php" in front of the file you wanted to run.

thanks .. I just realised what I had done when m4yadult posted


thanks guys for the help :thumbsup

frank7799 09-12-2009 03:01 PM

Quote:

Originally Posted by halfpint (Post 16311477)
thanks guys for the help :thumbsup

No problem.

PornMD 09-12-2009 03:42 PM

GFY CAN be a beautiful thing - problem solved in 20 mins, nice.

halfpint 09-12-2009 03:47 PM

Quote:

Originally Posted by PornMD (Post 16311585)
GFY CAN be a beautiful thing - problem solved in 20 mins, nice.

Yep and its free ....people bitch about GFY all the time :(

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

HomerSimpson 09-12-2009 04:38 PM

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

fris 09-12-2009 04:40 PM

make sure the php file has a shebang

brassmonkey 09-12-2009 04:49 PM

Quote:

Originally Posted by HomerSimpson (Post 16311719)
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

yep :) .


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