Nginx Imagejpeg

Asked

Viewed 29 times

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

  • how do I do that ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.