On Wednesday 23 April 2008 06:29:51 [EMAIL PROTECTED] wrote:
> I am running the following script and it runs fine in a browser - without
> errors and it is sending e-mail as expected and deleting files BUT I get
> the following error when I set it as a CRON.
>
> /bin/sh: /home/tonya/public_html/cron/relay.php: Permission denied
>
> The cron command is -
>
> */15 * * * * /home/domain/public_html/cron/relay.php
>

Hi.

The problem is probably that cron wants to run the php file, but it's not 
exacutable.  You can see this in the permission of files which code goes 
something like this rwx or read-write-execute. 
Although the file shouldn't be executable, because it isn't.
You need to call your script in the cron through php, php4 or php5 command:

*/15 * * * * php /home/domain/public_html/cron/relay.php

depending on which version you have on the server. And if you call a php file 
from the console you have to call it through the php command.

regards
mmlado

Reply via email to