IMAP or Internet Message Access Protocol is a protocol for accessing email from an IMAP server for online/offline/disconnected operations. This protocol was developed 20 yrs ago at Stanford University. One of the current active implementation with rewritten c-library is maintained under the supervison of the University of Washington. The latest IMAP - although its name might not sound to imply - also support POP protocol. A few open source applications for email management like SquirrelMail and IMP rely on IMAP in conjunction with PHP.
Backgrounder on PHP:
PHP or (Phils Homepage Tools)PHP Hypertext Preprocessor is an Open Source scripting language mainly used for web applications (although it can be used for desktop applications through its CLI, an example of a GUI implementation of PHP is PHP-GTK. PHP is server side, which means the processing is loaded to the server. Over the years the PHP Platform has proven its effectiveness, although still under debate :) , even some Java-based servers attempts to fully implement PHP because of its proven robustness (ex. Resin). One of the popular applications that run PHP is Mambo. SugarCRM, IMP, SquirrelMail implements PHP in conjunction with IMAP
The Problem:
I have encountered some problems getting PHP to compile with IMAP. For some reason my Apache died on 1st compile attempt of PHP with IMAP which caused one of the livesites I administer to be down. I tried different combinations of PHP 4.4.1, PHP 5.1.6, PHP 5.2.0 on IMAP-2004g, IMAP-2006c, IMAP-DEVEL. It was one nightmare i had to venture on. In the hope of easing someone not to go the same route I did. The whole trial and error costed me straight 25 hrs.
I have installed the 3 different versions of IMAP in the same way as outlined:
- Uncompressed the gzipped source tarball
- Inititated make using "make gso" (was on a Solaris 9)
- Made 2 symlinks pointing to the c-client libraries directory as "lib" and "include"
- PHP 4.4.1 + imap-2006d.DEV.SNAP-0611062033
- PHP 5.1.6 + imap-2006d.DEV.SNAP-0611062033
- PHP 5.2.0 + imap-2006d.DEV.SNAP-0611062033
- PHP 4.4.1 + imap-2006c1
- PHP 5.1.6 + imap-2006c1
- PHP 4.4.1 + imap-2004g
- PHP 5.1.6 + imap-2004g
- PHP 5.2.0 + imap-2004g
- cd c-client - Changed directory to c-client inside the extracted IMAP
- edited MakeFile to include: BASECFLAGS="-fPIC -O3" specifically on the GSO line for Solaris
- mkdir shared - Made a temporary directory
- cd shared - Changed directory to the temporary directory
- ar xv ../c-client.a - Extracted the *.o files
- gcc -shared -o c-client.so *.o - Derive a shared c-client..so from the *.o files
- cp c-client.so /usr/local/imap/imap2006c1/c-client libclient.so -Thanks to Ben for the correction
- hide libc-client.a (by adding "." before the name")
- cd ..
- ln -sf c-client include
- ln -sf c-client lib
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --enable-mbstring --with-gd --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-zlib --with-curl --with-pgsql=/usr/local/pgsql --with-gettext --with-ncurses --with-imap=/usr/local/imap/imap-2006c1/ --with-imap-ssl=/usr/local/ssl/