chriscloyd Posted December 16, 2006 Share Posted December 16, 2006 i need a php script to run every 10 minutes but then i get an email saying there was an error Quote Link to comment Share on other sites More sharing options...
Danny Beckett Posted December 16, 2006 Share Posted December 16, 2006 Well what was the error? Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted December 16, 2006 Author Share Posted December 16, 2006 public_html/test22/includes/delete_spam.php: line 1: ?php: No such file or directorypublic_html/test22/includes/delete_spam.php: line 2: syntax error near unexpected token `"../db.php"'public_html/test22/includes/delete_spam.php: line 2: `include("../db.php");' Quote Link to comment Share on other sites More sharing options...
steviewdr Posted December 16, 2006 Share Posted December 16, 2006 For cronjobs - you need to specify full system paths. You also need to make sure that cron can run php. You might have to specify something like:/usr/bin/php /home/user/public_html/file.phpYou also need to make sure that permissions are correct on the file.A last resort if the above doesnt work is to specify this command in cron:/usr/bin/wget http://mywebsite.com/myfile.phpThe above will definately work.-steve Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted December 16, 2006 Author Share Posted December 16, 2006 when u say[QUOTE]specify this command in cron[/QUOTE]what do u mean like the command i ahve right now is/usr/bin/php /home/user/public_html/test22/includes/delete_spam.php Quote Link to comment Share on other sites More sharing options...
steviewdr Posted December 16, 2006 Share Posted December 16, 2006 [code]/usr/bin/php /home/user/public_html/test22/includes/delete_spam.php[/code]If thats what you have - it should work. I take it you have tried the above script on the server itself (via a system() ) or exec function, or better yet - when logged into the server (via ssh or ftp)??If the above aint work - I would go the wget route.-steve Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted December 16, 2006 Author Share Posted December 16, 2006 okay i get this error after the code i ahve right now just ranStatus: 404X-Powered-By: PHP/4.4.4Content-type: text/htmlNo input file specified. Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted December 16, 2006 Author Share Posted December 16, 2006 this is now what i got/bin/sh: /usr/bin/wget: Permission denied Quote Link to comment Share on other sites More sharing options...
steviewdr Posted December 16, 2006 Share Posted December 16, 2006 /bin/sh: /usr/bin/wget: Permission deniedApache may not be able to run wget so. Thats that option done.Basically you just want cron to run/access a php script. You will have to do some more digging.Best of Luck with it.-steve Quote Link to comment 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.