Jump to content


Photo

PHP and Cronjobs


  • Please log in to reply
4 replies to this topic

#1 referlive

referlive
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 17 August 2003 - 07:28 PM

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

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 17 August 2003 - 11:47 PM

can you provide more specifics, i.e.: the error message, the code?
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 robomanusa

robomanusa
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 21 August 2003 - 02:18 AM

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
--Nick

#4 kosta

kosta
  • New Members
  • Pip
  • Newbie
  • 1 posts
  • LocationNew Jersey

Posted 24 August 2003 - 05:37 AM

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

#5 referlive

referlive
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 24 August 2003 - 03:19 PM

I did what Nick suggested. I put \"php\" before the full path of my file. It worked :)

Thank you all for your help!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users