Jump to content

Recommended Posts

Hi There,

i wonder if anyone can help me....

i have some php scripts in a directory on my web server and want them to run and specific times using a cron tab. I thought i had set them up correctly but the email confirmation it sends when it performs a cron says:

/bin/sh: line 1: /home/my-username/public_html/my-website/crons/check-links.php: Permission denied

what am i doing wrong?

can anyone shed some light on it.

Thanks in advance

Seamless.
Link to comment
https://forums.phpfreaks.com/topic/9311-cron-jobs/
Share on other sites

[!--quoteo(post=372287:date=May 8 2006, 10:16 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ May 8 2006, 10:16 AM) [snapback]372287[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Check the permissions on the PHP scripts you're trying to run. Make sure other scripts have the ability to run them (or use chmod 777 on them just to be safe).
[/quote]
If Ober's answer doesn't, check with your ISP. Many ISP's disable user crons, but when talked to nicely will set individual ones up foryou.
Link to comment
https://forums.phpfreaks.com/topic/9311-cron-jobs/#findComment-34312
Share on other sites

[!--quoteo(post=372296:date=May 8 2006, 10:36 AM:name=Lofty)--][div class=\'quotetop\']QUOTE(Lofty @ May 8 2006, 10:36 AM) [snapback]372296[/snapback][/div][div class=\'quotemain\'][!--quotec--]
If Ober's answer doesn't, check with your ISP. Many ISP's disable user crons, but when talked to nicely will set individual ones up foryou.
[/quote]

I've set chmod on all my cron file to 777 and i am now getting different errors:

/home/my-username/www/my-website/crons/check-links.php: line 1: ?
: No such file or directory
/home/my-username/www/my-website/crons/check-links.php: line 2:
: command not found
/home/my-username/www/my-website/crons/check-links.php: line 3: =: command not found
/home/my-username/www/my-website/crons/check-links.php: line 3:
: command not found
/home/my-username/www/my-website/crons/check-links.php: line 4: =: command not found
/home/my-username/www/my-website/crons/check-links.php: line 4:
: command not found
/home/my-username/www/my-website/crons/check-links.php: line 5: =: command not found
/home/my-username/www/my-website/crons/check-links.php: line 5:
: command not found
/home/my-username/www/my-website/crons/check-links.php: line 6: =: command not found
/home/my-username/www/my-website/crons/check-links.php: line 6:
: command not found
/home/my-username/www/my-website/crons/check-links.php: line 7:
: command not found
/home/my-username/www/my-website/crons/check-links.php: line 9: syntax error near unexpected token `('
/home/my-username/www/my-website/crons/check-links.php: line 9: `$connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd") or die ("Couldn't connect to server.");
'

The files are php, and if i access them via a browser they work correctly that way, am i doing something else wrong?

Thanks

Seamless
Link to comment
https://forums.phpfreaks.com/topic/9311-cron-jobs/#findComment-34556
Share on other sites

[!--quoteo(post=372574:date=May 9 2006, 08:29 AM:name=v3x)--][div class=\'quotetop\']QUOTE(v3x @ May 9 2006, 08:29 AM) [snapback]372574[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Dumb question but how do you make it execute a PHP script?
[/quote]

well after some research i'm entering this into my cron settings via cpanel:

curl -s -o /dev/null [a href=\"http://www.my-website.com/crons/check-links.php\" target=\"_blank\"]http://www.my-website.com/crons/check-links.php[/a]

i'm not getting an email now saying there is an error, so can i assume that as long as the php script is correct its doing its job?

Seamless.
Link to comment
https://forums.phpfreaks.com/topic/9311-cron-jobs/#findComment-34854
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.