Help - Search - Members - Calendar
Full Version: HOW: Running a PHP script under cronjob.
The Planet Forums > Control Panels > cPanel/WHM
SuperBaby
I setup a cronjob under cPanel for my auction site. This cronjob is scheduled to run once a day. But I sometimes receive error reporting via email:

/bin/sh: line 1: /home/username/public_html/cron/cron1.php: Permission denied

Since the cron is setup to run ONCE a day and I am not getting this error everyday, I am not sure if the cronjob is setup properly.

The original cron command in the auction program manual is:
QUOTE


Since it gave me constant errors, I use this instead:
QUOTE
/home/machine2/public_html/cron/cron1.php


Please help.
kfukasawa
Let me make sure that I fully understand. Are you running the command like this?

CODE
GET /home/machine2/public_html/cron/cron1.php
SuperBaby
QUOTE

I used the above as stated in the manual but constantly got error report from the cron daemon.

So I changed to
QUOTE
/home/machine2/public_html/cron/cron1.php

With the above, I sometimes received Permission Denied error report.

Someone suggested this
QUOTE
/usr/bin/php /home/machine2/public_html/cron/cron1.php
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.