I have a php file which runs a script to pull an image from a website and save it in a folder every minute (a webcam if you're interested). If I go to the url where the file sits, the page works and the image is saved. I am trying to set up a cron job in cpanel to do this automatically so I don't have to keep my browser open. The image below shows my settings but I am getting nothing. I have set it to send me an email everytime the job runs but I don't get that either. I am new to this so any help greatly appreciated.
Asked
Active
Viewed 2,528 times
1

sam
- 345
- 3
- 12
1 Answers
2
I can't tell much from the info you gave in , but I have similar type of issue, and what I found out was that I have included .php
files in my cron.php
and that those links(paths) were not correct for the cron job, but were correct when I opened in browser the php file.
and please check the link in the cpanel the command curl link if it's correct I use something like this
/usr/bin/php /var/www/vhosts/something.com/httpdocs/Cron.php
-
1thanks I have tried: /usr/bin/php -q /home/username/public_html/index.php but still nothing.... Is there any way I can see any errors or antyhing? I have added about 5 variations to see if any work, will having some with the inccect syntax stop the others working? – sam Feb 10 '14 at 09:31
-
1Try to make a cronjob.php file that will send you mail just to see if the path to the cron job is bad or the script that you are trying to run has some errors – denza Feb 10 '14 at 09:48
-
1see your error_log it should sit in the folder above public_html. As the answer here states your url is wrong, getting it right should be enough. – Feb 10 '14 at 13:58
-
1see: http://stackoverflow.com/questions/7332804/run-a-php-file-in-a-cron-job-using-cpanel?rq=1 – Feb 10 '14 at 13:59