A non-numeric value in class.image.php when I use nginx

DeCysos

Phoenix Foto Service
License owner
🎯Description of the issue
To my server configuration:
I use the following on the system mentioned here (TEST):
- php7.3.12 as FTM application with nginx as proxy reverse with Apache

That means that this uses FastCGI?
Anyway, I've activated everything in the PHP handler 7.3.12:
- FPM
- FastCGI
- CGI
The following scenario:


So it has something to do with the NSFW attitude? Respectively with the listing of the contents?

▶🚶‍Reproduction steps
- Create an album (name does not matter)
- Download 2 pictures in this album
- Mark one of the pictures as NSFW
- Click on the NSFW image to open.
--- The image opens with an error message
+ If you want to open the unmarked image, there is no error message.

Show: https://ubuntuserver.t-ad.de/image/geran-de-klerk-bkhetedv1wm-unsplash-min.em2V
From Album: https://ubuntuserver.t-ad.de/album/testalbum.l5L

[Server is unfortunately only online if I am synonymous, because as I said only a test system which runs on the same configuration as the live system, just with Nginx as a proxy]
screenshot-ubuntuserver.t-ad.de-2019.12.03-00-52-05.png


😢Unexpected result

The image opens with an error message


📃Error log message

ServerLog - proxy_error.log:
2019/12/02 23:40:59 [error] 1299#0: *389 FastCGI sent in stderr: "PHP message: PHP Warning:  A non-numeric value encountered in /var/www/vhosts/ubuntuserver.t-ad.de/httpdocs/app/lib/classes/class.image.php on line 259PHP message: PHP Warning:  A non-numeric value encountered in /var/www/vhosts/ubuntuserver.t-ad.de/httpdocs/app/lib/classes/class.image.php on line 263PHP message: PHP Warning:  A non-numeric value encountered in /var/www/vhosts/ubuntuserver.t-ad.de/httpdocs/app/lib/classes/class.image.php on line 264" while reading response header from upstream, client: MYIPADRESS, server: ubuntuserver.t-ad.de, request: "GET /image/geran-de-klerk-bkhetedv1wm-unsplash-min.em2V HTTP/2.0", upstream: "fastcgi://unix:///var/www/vhosts/system/ubuntuserver.t-ad.de/php-fpm.sock:", host: "ubuntuserver.t-ad.de", referrer: "https://ubuntuserver.t-ad.de/album/testalbum.l5L"
class.image.php:
            if ($image_album_slice['images'][$album_cursor-1]) {
                $image_album_slice['prev'] =  $image_album_slice['images'][$album_cursor-1];
            }

            if ($image_album_slice['images'][$album_cursor+1]) {
                $image_album_slice['next'] = $image_album_slice['images'][$album_cursor+1];
            }
🛠 What I could do?

I could put a @ in front of $image_album_slice['images'] to suppress the error.
What can I do to prevent this error from being written?

Because sooner or later I would like to switch to nginx.
 
Last edited:

DeCysos

Phoenix Foto Service
License owner
I could fix it like this
class.image.php:
            #$album_cursor = ''; // Variable darf nicht leer sein in FastCGI
            foreach ($image_album_slice_db as $k => $v) {
                if ($v['image_id'] == $image_id) {
                    $album_cursor = $k;
                    break;
                }
            }

            $image_album_slice['images'] = array();

            foreach ($image_album_slice_db as $k => $v) {
                $image_album_slice['images'][$k] = self::formatArray($v);
            }

            if ($image_album_slice['images'][$album_cursor-1]) {
                $image_album_slice['prev'] =  $image_album_slice['images'][$album_cursor-1];
            }

            if ($image_album_slice['images'][$album_cursor+1]) {
                $image_album_slice['next'] = $image_album_slice['images'][$album_cursor+1];
            }
But I'm not sure if that's okay, as it certainly has its reason that $ album_cursor should be empty.

As I said with the pure Apache + php FPM it works without error message.
Only Apache + Nginx + php-FPM spits it out an error. Whereby Nginx FPM also uses FastCGI for whatever reason.
 
Top