Vincent M.
August 03, 2021 03:16PM
Hello all,

I have a 403 error when trying to use the PHP function getimagesize on
nginx based web server:

list($imageWidth, $imageHeight) = getimagesize($imagesSource['Main']);

Where $imageSource['Main'] is like:


It's an image generated by PHP-imagick module and is not locally
available. This image can be opened by a browser with no problem.

To generate this image which go through 404. Nginx is configured like that:

error_page 404 = /url_rewriting.php;
And in the file url_rewriting.php, we analyse the URL to see if it's
real 404 or an image which must be generated:

if((isset($urlHash[2]) && $urlHash[2] === 'render')) {
    header('Status: 200 OK', false, 200);
    require ('include/php/render/'.$_GET['render'].'/render_img.php');
All is working fine but not the getimagesize from my own server.

What is strange is that it's working fine on my development environment
which has the same versions of nginx and PHP and pretty the same

It might a configuration issue or a right issue on a certain file but I
don't know where to check.

Thank you,

nginx mailing list
Subject Author Posted

nginx getimagesize from local server: 403

Vincent M. August 03, 2021 03:16PM

Re: nginx getimagesize from local server: 403

Vincent M. August 04, 2021 07:52AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 67
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready