--- [EMAIL PROTECTED] wrote: > Hi All, > > Firstly thanks James for the help with the REGEX - all woring in that regard > now. > > On my server PHP version 4.x.x runs by default so I use the following in a > .htaccess file to force version 5.x.x > > .htaccess > AddHandler application/x-httpd-php5 .php > > 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
You are trying to run the relay.php as an executable which it probably is not (ls -l will tell you if you can decipher the abbreviations). Hopefully you have the command line version of PHP. Most of the time it is located at /usr/bin/php. You can run a command like: whereis php to get the path. Once you have the location, edit your crontab to use it: */15 * * * * /usr/bin/php /home/domain/public_html/cron/relay.php James