Computing.Net > Forums > Linux > Crontab problem

Crontab problem

Reply to Message Icon

Original Message
Name: Mike
Date: November 7, 2003 at 21:29:16 Pacific
Subject: Crontab problem
OS: Linux Red Hat 9
CPU/Ram: 1.0 GHZ
Comment:

I am trying to get my server to run a PHP script every hour and half hour by means of Crontab, and I have it entered in right 0,30 * * * * /usr/bin/file_name.php but it does not run. I am running it under the root user (root@mydomain) Anybody have any suggestions?


Report Offensive Message For Removal

Response Number 1
Name: yourfriend411
Date: November 8, 2003 at 00:26:18 Pacific
Subject: Crontab problem
Reply: (edit)

Hi , Mike

I don't think you can run a PHP script through crontab. PHP script will only be executed when a request is made from your web server. What are you trying to do with that PHP script, perhaps you could try to use Perl?


Report Offensive Follow Up For Removal

Response Number 2
Name: gmoney
Date: November 8, 2003 at 10:30:35 Pacific
Subject: Crontab problem
Reply: (edit)

I agree with yourfriend411 that it's preferable to use something like Perl in cron or from the command line in general, but PHP 4.2 and above added the ability to run PHP from the command line. Go to http://www.php.net and in the table of contents for the PHP manual there's a section on running PHP from the commandline which means it will probably run from cron too.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Crontab problem

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software