Seamless Posted May 8, 2006 Share Posted May 8, 2006 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 deniedwhat am i doing wrong?can anyone shed some light on it.Thanks in advanceSeamless. Quote Link to comment https://forums.phpfreaks.com/topic/9311-cron-jobs/ Share on other sites More sharing options...
ober Posted May 8, 2006 Share Posted May 8, 2006 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 Link to comment https://forums.phpfreaks.com/topic/9311-cron-jobs/#findComment-34303 Share on other sites More sharing options...
dtc Posted May 8, 2006 Share Posted May 8, 2006 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/9311-cron-jobs/#findComment-34312 Share on other sites More sharing options...
Seamless Posted May 9, 2006 Author Share Posted May 9, 2006 [!--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?ThanksSeamless Quote Link to comment https://forums.phpfreaks.com/topic/9311-cron-jobs/#findComment-34556 Share on other sites More sharing options...
Brandon Jaeger Posted May 9, 2006 Share Posted May 9, 2006 Dumb question but how do you make it execute a PHP script? Quote Link to comment https://forums.phpfreaks.com/topic/9311-cron-jobs/#findComment-34582 Share on other sites More sharing options...
Seamless Posted May 10, 2006 Author Share Posted May 10, 2006 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/9311-cron-jobs/#findComment-34854 Share on other sites More sharing options...
.josh Posted May 11, 2006 Share Posted May 11, 2006 yes. unless it's not running at all. like, you somehow disabled it instead. does your script update a table? go to phpmyadmin and see if the table is being updated. Quote Link to comment https://forums.phpfreaks.com/topic/9311-cron-jobs/#findComment-35208 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.