Search code examples
phppathlaravellaravel-3base-path

php imagejpeg path in laravel broken


my imagejpeg function is failing on my remote website, works fine locally.

This is the code I'm using at the moment wich works fine locally.

imagejpeg($dst_r, path('public') . 'thumbnails/' . $filename ,$jpeg_quality);

When I try it out on my remote website I get:

Unable to open '/home/deb65018/domains/mywebsite.com/designs/public/thumbnails/1308341733389.jpg' for writing: No such file or directory

I've tried this aswell:

imagejpeg($dst_r, URL::base() . '/thumbnails/' . $filename ,$jpeg_quality);

But using the basepath somehow breaks my code even locally by giving me a "Unable to open" error.

Can anyone point out my stupid mistakes?


Solution

  • Take a look to the log, Usually are located here /var/log/httpd/error.log in linux or easier turn on display errors in php How do I get PHP errors to display? In this way you can check with more detail the error