Cron Job php config

Status
Not open for further replies.

thomaswprice80

New Member
Messages
1
Reaction score
0
Points
0
Hey, I love your site, but I've got a small problem. I've got a php script that needs to access an image from another website. It works fine when I run it manually by navigating to it, but I've tried to set up to run as a cron job, and I get this error in the log: "[27-Jan-2011 16:20:01] PHP Warning: file_get_contents() [<a href='function.file-get-contents'>function.file-get-contents</a>]: URL file-access is disabled in the server configuration in /home/thomaswp/public_html/cron.php on line 10". Do you have a different configuration for running php scripts though cron? Because it works fine when I run it manually. Any suggestions?
 

calistoy

Free Support Volunteer
Community Support
Messages
5,602
Reaction score
87
Points
48
Here's what the problem is:

"[27-Jan-2011 16:20:01] PHP Warning: file_get_contents() [<a href='function.file-get-contents'>function.file-get-contents</a>]: URL file-access is disabled in the server configuration in /home/thomaswp/public_html/cron.php on line 10".

I've bolded the important part of the message we need to look at. What you are trying to do in your php script is disabled on free hosting accounts. That means it's not the cron that's the problem. You'll need make other plans of what you wanted to do.

Edit: I'm very sorry; it turns out I was wrong.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
The setup for cron jobs is the problem.

His script works when run manually (from the Web), but not when run from a cron job. There is a similar problem with the PHP mail() function.
 
Status
Not open for further replies.
Top