note 125423 deleted from image.installation by cmb
| From: | cmb@php.net | Date: | Thu, 08 Oct 2020 15:16:08 +0000 |
| Subject: | note 125423 deleted from image.installation by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215551@lists.php.net to get a copy of this message | ||
Note Submitter: gonperes
----
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.