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 Link to comment https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/ Share on other sites More sharing options...
Danny Beckett Posted December 16, 2006 Share Posted December 16, 2006 Well what was the error? Link to comment https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142395 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");' Link to comment https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142401 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 Link to comment https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142415 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 Link to comment https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142419 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 Link to comment https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142421 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. Link to comment https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142422 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 Link to comment https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142425 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 Link to comment https://forums.phpfreaks.com/topic/30877-cron-job-on-cpanel/#findComment-142463 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.