Installing PHP w/ IMAP support on Slackware
When installing PostfixAdmin, I found that I need to re-compile PHP to support IMAP, but later more problems came to me.
Environment: Linux mail 2.6.27.7-smp #2 SMP Thu Nov 20 22:32:43 CST 2008 i686 Intel(R) Xeon(R) CPU E5405 @ 2.00GHz GenuineIntel GNU/Linux
Q: PHP configure utility reports that there is no IMAP support on my system.
A: According to PHP Manual: IMAP Installation, I need to get something named c-client, and compile PHP with --with-imap[=DIR].
Q: Where to get c-client?
A: Googled answer IMAP Information Center: The software and documentation is available at ftp://ftp.cac.washington.edu/imap. UW IMAP toolkit
source distribution is available at ftp://ftp.cac.washington.edu/mail/imap.tar.Z.
Q: So strange a package, how to make and install?
A: Normally, you should run configure, make and make install to install a package from source, but no configure found and make is different.
First, make sure you have OpenSSL installed, and then follow the setps:
Extract the archive downloaded to /usr/local folder named imap-2007e
1 2 3 4 5 6 7 8 9 10 | cd /usr/local/imap-2007e # slx means Linux using -lcrypt to get the crypt() function make slx # BTW: you are supposed to fail this step, see notes below mkdir include mkdir lib cd c-client cp *.h ../include/ cp *.c ../lib/ ln -s ../c-client/c-client.a ../lib/libc-client.a |
NOTE:
If you like me discover that “make slx” fails, but you’re damn sure you’ve openssl installed then, it might be that the lib and include paths on your distribution are different then the defaults provided in the imap-2007e (or imap-XXXXx). To modify go to dir src/osdep/unix and edit Makefile, around L55:
1
2
3
4
5
6
7
8
9 # Extended flags needed for SSL. You may need to modify.
SSLDIR=/usr/local/ssl
SSLCERTS=$(SSLDIR)/certs
SSLKEYS=$(SSLCERTS)
SSLINCLUDE=$(SSLDIR)/include
SSLLIB=$(SSLDIR)/lib
SSLCRYPTO=-lcryptoChange SSLDIR, SSLINCLUDE and SSLIB to valid paths for Slackware. In my case, it should like this:
1
2
3
4
5
6
7
8
9 # Extended flags needed for SSL. You may need to modify.
SSLDIR=/etc/ssl
SSLCERTS=$(SSLDIR)/certs
SSLKEYS=$(SSLCERTS)
SSLINCLUDE=/usr/include/openssl
SSLLIB=/usr/lib
SSLCRYPTO=-lcryptoYou should also check your ld.so.conf for valid paths.
Q: How to compile PHP w/ IMAP support?
A: Finally, we’ve reached the last step. Re-compile PHP and everything is done. When configuring, just add those two imap options
1 2 3 | ./configure ... --with-imap=/usr/local/imap-2007e --with-imap-ssl make make install |
Bing! Your system is ready for your imap application.
hehe…
Q: did you scare me?
A: yes, you did:)
[Reply]