note 125423 added to image.installation

From: Date: Thu, 08 Oct 2020 14:55:44 +0000
Subject: note 125423 added to image.installation
Groups: php.notes 
Request: Send a blank email to php-notes+get-215550@lists.php.net to get a copy of this message
Actually there was a problem with my first note (https://www.php.net/manual/en/image.installation.php#125421). I could run "./configure" on PHP 7.4.11 and make and install, after installing libjpeg-9c, but then I got this warning in the logs and all the functions that used libjpeg didn't work: "PHP Warning: imagejpeg(): gd-jpeg: JPEG library reports unrecoverable error: Wrong JPEG library version: library is 80, caller expects 90 in /var/www/(...)" After this error, I searched deeper into the problem and found what was really causing the error of the "missing jpeglib" running "./configure" --------- checking for libjpeg... no configure: error: Package requirements (libjpeg) were not met: No package 'libjpeg' found --------- The problem is that PHP 7.4.11 GD with JPEG support expects the existence of "libjpeg.pc" in "/usr/local/lib/pkgconfig" dir. When you install "libjpeg-9c", this file is created, but then the bundle GD library is linked to a previous version of libjpeg (JPEG_LIB_VERSION) 8 in my case, which was already installed. So the solution was to create a "libjpeg.pc" in "/usr/local/lib/pkgconfig" pointing to the correct libjpeg (8) ----- libjpeg.pc -------- prefix=/usr exec_prefix=${prefix} libdir=${prefix}/lib/x86_64-linux-gnu includedir=${prefix}/include Name: libjpeg Description: JPEG image codec Version: Libs: -L${libdir} -ljpeg Cflags: -I${includedir} ------ After this you can run "./configure --enable-gd --with-jpeg (...)" and everything will work as it should. ---- Server IP: 45.112.84.4 Probable Submitter: 185.85.3.172 (proxied: 94.62.246.65) ---- Manual Page -- http://php.net/manual/en/image.installation.php Edit -- https://master.php.net/note/edit/125423 Del: integrated -- https://master.php.net/note/delete/125423/integrated Del: useless -- https://master.php.net/note/delete/125423/useless Del: bad code -- https://master.php.net/note/delete/125423/bad+code Del: spam -- https://master.php.net/note/delete/125423/spam Del: non-english -- https://master.php.net/note/delete/125423/non-english Del: in docs -- https://master.php.net/note/delete/125423/in+docs Del: other reasons-- https://master.php.net/note/delete/125423 Reject -- https://master.php.net/note/reject/125423 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#215550) next »