referlive Posted August 17, 2003 Share Posted August 17, 2003 Hello, My website runs on a dedicated Linux server. I\'m trying to run a cronjob that will run a script called \"followup.php\". So, the full URL of this script is http://www.mydomain.com/followup.php And the path to this script is /home/admin/mydomain.com/htdocs/followup.php The only control panel I got is Webmin. When I first tried to schedule this cronjob, I got an error saying \"Permission\" denied. I went and changed the CHMOD for the file in question to 777. Now when I run it, it gives me strange error message, which include the first few lines of code in that script. What am I doing wrong? If you could answer me, I would be forever grateful! PS: I tried this through SSH, but I still got an error message! Thank you so much, Jimmy Quote Link to comment https://forums.phpfreaks.com/topic/908-php-and-cronjobs/ Share on other sites More sharing options...
effigy Posted August 17, 2003 Share Posted August 17, 2003 can you provide more specifics, i.e.: the error message, the code? Quote Link to comment https://forums.phpfreaks.com/topic/908-php-and-cronjobs/#findComment-3028 Share on other sites More sharing options...
robomanusa Posted August 21, 2003 Share Posted August 21, 2003 the permissions on your php file do not need to be no more than 0644 and to have cron execute a php script you need to tell the system what type of file its gonna be executing. In your case this is what you would enter into the command box for cron in webmin: php /home/admin/mydomain.com/htdocs/followup.php then set your times to run the cronjob in your selection boxes below it and save it. Also dont forget at the top of your cronjob setup page in webmin is the box that you tell cron what user is executing it,It must be a user with access to run cron jobs. Hope that helps Quote Link to comment https://forums.phpfreaks.com/topic/908-php-and-cronjobs/#findComment-3087 Share on other sites More sharing options...
kosta Posted August 24, 2003 Share Posted August 24, 2003 have you tried doing crontab -e within ssh to see if you have access to crontab? if not, you might have to add yourself to the allowed crontab users Kosta Quote Link to comment https://forums.phpfreaks.com/topic/908-php-and-cronjobs/#findComment-3156 Share on other sites More sharing options...
referlive Posted August 24, 2003 Author Share Posted August 24, 2003 I did what Nick suggested. I put \"php\" before the full path of my file. It worked Thank you all for your help! Quote Link to comment https://forums.phpfreaks.com/topic/908-php-and-cronjobs/#findComment-3165 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.