|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-04-11 07:40 UTC] mrskman at gmail dot com
Description: ------------ It looks like PHP is linking with wrong version of libpng if you use another version using --with-png-dir and a system version of the library is installed. I built PHP with --with-png-dir=/opt/httpd/2.4.39/build and during some testing I was getting this error: libpng warning: Application was compiled with png.h from libpng-1.6.35 libpng warning: Application is running with png.c from libpng-1.2.46 Segmentation fault (core dumped) Then I found that PHP was linked with the system version of libpng: ldd /opt/httpd/2.4.39/build/bin/php7 | grep png libpng12.so.0 => /usr/lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f38e84fb000) After removing libpng12-dev from my system I recompiled PHP with the same command and it is OK now: ldd /opt/httpd/2.4.39/build/bin/php7 | grep png libpng16.so.16 => /opt/httpd/2.4.39/build/lib/libpng16.so.16 (0x00007f884dd54000) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 21:00:01 2025 UTC |
Hello, PHP <= 7.3 versions using custom compiled libpng libraries that are installed on custom locations can be done using: ./configure --with-gd --with-png-dir=/path/to/libpng/usr/local Note the `usr/local` attached at the end. The config.m4 file checking for the location will first check for the custom location provided with the configure option, then go to system /usr/include directory and so on. http://git.php.net/?p=php-src.git;a=blob;f=ext/gd/config.m4;h=498d870785e86ff4a49d87082e3fed2a4c4d32f9;hb=refs/heads/PHP-7.3#l129 PHP 7.4 is using pkg-config so something like this won't work anymore. There the environment variables will need to be used in front of ./configure command...