If you need to install IMAP support for php on a 64-bit machine, it is not that simple. There are some additional steps you need to follow to make it working.
First of all, you may try to reconfigure PHP. If you have Directadmin or any other control panel installed, you might have imap library installed. Just add –with-imap –with-imap-ssl to your ./configure line.
Most probably you will get this error: configure: error: Cannot find imap library (libc-client.a). Please check your IMAP installation.
Here are some simple steps to resolve the issue and get this done.
yum install libc-client libc-client-devel uw-imap-devel uw-imap-static uw-imap-utils
This will install imap itself.
yum install krb5-appl-clients.x86_64
yum install krb5-appl-servers.x86_64
This will add kerberos support to your system.
Now you can try configuring PHP again. If the steps above don’t help and you get the same error message, let’s add x64 and x86 libraries to your system.
yum install libc-client-devel.i686 and libc-client-devel.x86_64
This most probably will install lots of dependencies (I had 62). But that was the trick. Now you can go to your PHP configuration.
./configure --with-apxs2 --with-curl=/usr/local/lib --with-gd --enable-gd-native-ttf --with-gettext --with-jpeg-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --with-kerberos --with-openssl --with-mcrypt --with-mhash --with-pear --with-png-dir=/usr/local/lib --with-zlib --with-zlib-dir=/usr/local/lib --enable-zip --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --enable-sockets --enable-mbstring --enable-pcntl --enable-dba --with-db4=/opt --with-iconv=/usr/local/lib/ --with-mysqli --with-mysql=/opt --with-imap --with-imap-ssl
make
make install
service httpd restart
You must now enjoy IMAP functions in PHP.