[Cronjob]PHP Warning: getimagesize(): failed to open stream: No such file or directory

Status
Not open for further replies.

sicelx10

Member
Messages
126
Reaction score
2
Points
18
When i execute my php script manually, runs perfectly, but when cron jobs runs that php script automatically i reveice an email with this error:

-PHP Warning: getimagesize(imagenes/cielomorado.jpg): failed to open stream: No such file or directory in /home/sicelx10/public_html/manipularimg/imagejpeg.php on line 6

NOTE: My script shows an image with a string (used imagestring).

This doesnt have sense :/
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
You can't use the same relative paths with a cron as you do with PHP scripts you run/initiate from a browser. "imagenes/cielomorado.jpg" does not point to where you think it's pointing to when a cron is running the script; the computer is looking for a file on a path relative to the cron tab and not to the PHP script the cron is running. See this question on StackOverflow for some ways to fix the path.
 

sicelx10

Member
Messages
126
Reaction score
2
Points
18
Thanks for the info :), im triying to fix this issue with that information but still not working :/
 
Status
Not open for further replies.
Top