Nginx Imagejpeg

1

I have this 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 code above works, showing the image, but after I updated it to Nginx it stopped working.

Error message:

  

Warning:
  imagejpeg (): Unable to open './cache/9c1dab025a5849852d4c4be74ee5d1bc.jpg' for writing:

I have already checked the permissions, user is www-data . Any tips are welcome

    
asked by anonymous 02.07.2016 / 12:01

0 answers