1
I have that code:
function show_image($mime_type, $image_resized) {
global $quality;
echo $cache_file = get_cache_file($mime_type);
switch ($mime_type) {
case 'jpg':
imagejpeg($image_resized, $cache_file, $quality);
//imagejpeg($image_resized);
break;
default:
case 'png':
imagepng($image_resized, $cache_file, floor($quality * 0.09));
break;
}
echo show_cache_file($mime_type);
}
In apache the above code works,showing the image, but after I upgraded to Nginx it stopped working.
Error message:
Warning:
imagejpeg(): Unable to open './cache/9c1dab025a5849852d4c4be74ee5d1bc.jpg' for writing:
I already checked the permissions, www-data
.
Any hint is welcome
But you have to give permission to
www-data
to write, 777– Miguel
how do I do that ?
– Diego Go