Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/908-php-and-cronjobs/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/908-php-and-cronjobs/#findComment-3087
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.