PHP 5.3.6 configure fails: libjpeg.(a|so) or libpng.(a|so) not found

Written by - 0 comments

Published on - Listed in PHP Linux


Just tried to compile PHP 5.3.6 with using the --with-libdir option. The compile process always failed because either libpng.(a|so) or libjpeg.(a|so) was not found:

# ./configure --prefix=/usr --with-libdir=/usr/lib64 --with-gd ....
...
checking for FreeType 2... no
checking for T1lib support... no
checking whether to enable truetype string function in GD... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... (cached) yes
checking for floorf... (cached) yes
If configure fails try --with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.

But libpng.so exists:

# ls -l /usr/lib64/ | grep png
lrwxrwxrwx  1 root root       10 Feb  7 11:43 libpng.a -> libpng12.a
lrwxrwxrwx  1 root root       11 Feb  7 11:43 libpng.so -> libpng12.so
lrwxrwxrwx  1 root root       13 Jul 17  2010 libpng.so.3 -> libpng12.so.0
-rw-r--r--  1 root root   242636 Jul 17  2010 libpng12.a
lrwxrwxrwx  1 root root       18 Feb  7 11:43 libpng12.so -> libpng12.so.0.27.0
lrwxrwxrwx  1 root root       18 Jul 17  2010 libpng12.so.0 -> libpng12.so.0.27.0
-rw-r--r--  1 root root   153072 Jul 17  2010 libpng12.so.0.27.0

Even a configure with the option --with-png-dir=/usr/lib64 didn't work.

The solution is not to use the full path in the --with-libdir option, but only the folder name of the library folder:

# ./configure --prefix=/usr --with-libdir=lib64 --with-gd ....
...
checking for FreeType 2... no
checking for T1lib support... no
checking whether to enable truetype string function in GD... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... (cached) yes
checking for floorf... (cached) yes
If configure fails try --with-jpeg-dir=<DIR>
checking for png_write_image in -lpng... (cached) yes
If configure fails try --with-xpm-dir=<DIR>
If configure fails try --with-freetype-dir=<DIR>
checking for GNU gettext support... yes
...

Unfortunately there is nothing written about this in ./configure --help.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Icingaweb   Icingaweb2   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder   


Update cookies preferences