tags:

views:

27

answers:

3

Hi I want to run a cron job to call a php script on my server. I am using Cpanel from my web host and these are the options

Minute:
Hour:
Day:
Month:
Weekday:
Command:

I am really strugling to point the command to my file i am using this line /home/abbeysof/public_html/adi/cron/daily.php

but I am getting this error

/bin/sh: /home/abbeysof/public_html/adi/cron/daily.php: Permission denied

I asked my web host for help and this is the response

If you use cpanel to create it, it will fill in the path for you. Typically /home/username/public_html/etc

Can anyone please offer some advice

Thanks Mick

+2  A: 

Sorry, I don't know anything about cpanel, but it sounds like:

  • if you created the file daily.php, then you need to change the permissions on it
  • if they created the file, then there's a bug in their creation routine.

Good luck!

khedron
A: 

Sounds like you need to make /home/abbeysof/public_html/adi/cron/daily.php executable.

Douglas Leeder
+2  A: 

Advise 1: use wget command, wget runs the PHP script exactly as if it was called from the web so the PHP environment is exaclty the same of when calling the file from the web, it' easier to debug your script then.

wget http://yourdomain.com/adi/cron/daily.php

The cron jobs has to be created going into cPanel cron jobs menu. I don't understand if you have this clear by reading your hoster's answer.

And advise 2: change webhosting, try this one they don't leave you alone.

Marco Demajo