PHP 5.4 compilation error: build with IMAP works... no

Written by - 0 comments

Published on - Listed in Linux PHP


Yesterday I tried to compile the newest PHP 5.4.14 on an opensuse 12.2 system but got stuck when configure was at the IMAP check.

checking for IMAP support... yes
checking for IMAP Kerberos support... no
checking for IMAP SSL support... yes
checking for utf8_mime2text signature... new
checking for U8T_DECOMPOSE...
checking for pam_start in -lpam... no
checking for crypt in -lcrypt... yes
checking whether rfc822_output_address_list function present... no
checking whether build with IMAP works... no
configure: error: build test failed. Please check the config.log for details.

At the begin I thought, that's easy to solve, as I already had this error before. The IMAP development files have a funny name called libc-client, at least that's what it was in the past. See my post "PHP compilation fails on IMAP U8T_DECOMPOSE: The Debian solution" for more information. But the imap dev files (they're now called imap-devel on opensuse) are already installed:

rpm -qa | grep imap-dev
imap-devel-2007e_suse-12.1.2.x86_64
# rpm -qa| grep libc-client
libc-client2007e_suse-2007e_suse-12.1.2.x86_64

ll /usr/lib64/ | grep libc-client
lrwxrwxrwx  1 root root       13 May  3 18:58 c-client.a -> libc-client.a
-rw-r--r--  1 root root  4887050 Jul 16  2012 libc-client.a
lrwxrwxrwx  1 root root       25 May  3 18:58 libc-client.so -> libc-client.so.2007e_suse
-rwxr-xr-x  1 root root  1108008 Jul 16  2012 libc-client.so.2007e_suse

So I took a look at the config.log, at the relevant information:

| #define HAVE_IMAP2000 1
| #define HAVE_IMAP2004 1
| /* end confdefs.h.  */
|
| #include
| #include
|
| int
| main ()
| {
|
|         SIZEDTEXT *src, *dst;
|         utf8_mime2text(src, dst);
|
|   ;
|   return 0;
| }
configure:65718: result: new
configure:65731: checking for U8T_DECOMPOSE
configure:65761: cc -c -I/usr/include/imap  conftest.c >&5
configure:65768: $? = 0
configure:65788: result:
configure:65927: checking for pam_start in -lpam
configure:65962: cc -o conftest -I/usr/include -g -O2 -fvisibility=hidden  -L/usr/lib64  conftest.c -lpam  -lfreetype -lpng -lz -ljpeg -lcurl -lbz2 -lz -lrt -lm -ldl -lnsl  -lxml2 -lz -lm -lssl -lcrypto -lcurl -lxml2 -lz -lm -lssl -lcrypto >&5
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: cannot find -lpam
collect2: error: ld returned 1 exit status
configure:65969: $? = 1
configure: failed program was:

This means that the IMAP check was actually successful, at the c-client header files were successfully included. But another message is very important in that output: "cannot find -lpam".
That's interesting... the information in the ./configure output is actually very misleading and makes one think there's a problem with the imap/libc-client devel files, but it actually seems to be a missing pam devel!

Install pam-devel and try again to configure:

zypper in pam-devel

[...]
checking for iconv support... yes
checking for iconv... yes
checking if iconv is glibc's... yes
checking if iconv supports errno... yes
checking if your cpp allows macro usage in include lines... yes
checking for IMAP support... yes
checking for IMAP Kerberos support... no
checking for IMAP SSL support... yes
checking for utf8_mime2text signature... new
checking for U8T_DECOMPOSE...
checking for pam_start in -lpam... yes
checking for crypt in -lcrypt... yes
checking whether rfc822_output_address_list function present... yes
checking whether build with IMAP works... yes
checking for InterBase support... no
checking whether to enable internationalization support... yes
[...]

Finally it ran through! From the beginning it actually required the pam-devel that the build with imap would work.

Side note: I also tried to compile imap from source (ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz)  to see if there was a problem in the opensuse devel files and the compilation failed with the following error:

`cat CCTYPE` -c `cat CFLAGS` `cat OSCFLAGS` -c osdep.c
osdep.c:89:31: fatal error: security/pam_appl.h: No such file or directory
compilation terminated.

That was another hint, that pam-devel was missing.


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   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