Hi,
Yes, I can give you a small "HOWTO":
1) Download the c-client:
ftp://ftp.cac.washington.edu/imap/c-client.tar.Z in a directory of your liking, for example your home directory. I will assume you download the file in you current directory.
2) Extract the c-client:
tar -zxvf c-client.tar.Z
3) Enter the c-client source directory:
cd imap-2002e (Of course, the directory name can vary if you extracted the client to another directory, or a new release comes available. At this moment 2002e is the latest stable version, but there is a 2004 beta.)
4) Check the file
Makefile to see how you should "Make" the c-client. (Look in Makefile and find your system type code. For example, modern versions of Linux will use either "slx", "lnp", "lrh", or "lsu".)
5) "Make" the c-client, for example:
make slx
NOTE: If you run RedHat 9, use this command:
make lrh EXTRACFLAGS=-I/usr/kerberos/include EXTRALDFLAGS=-I/usr/kerberos/lib
6) It's important that you do not copy the IMAP source files directly into the system include directory as there may be conflicts. Instead, create a new directory inside the system include directory, such as /usr/local/imap-2000e/ (location and name depend on your setup and IMAP version), and inside this new directory create additional directories named lib/ and include/. From the c-client directory from your IMAP source tree, copy all the *.h files into include/ and all the *.c files into lib/. Additionally when you compiled IMAP, a file named c-client.a was created. Also put this in the lib/ directory but rename it as libc-client.a.
7) Change the
configure.php in
/usr/local/directadmin/customapache. Add this line:
--with-imap=/usr/local/imap-2000e
at the end of the configure statement. Remember to add a "\" to the previous line. The configure statement should look like this:
PHP:
./configure \
--with-apxs \
--with-curl \
--with-curl-dir=/usr/local/lib \
--with-gd \
--with-gd-dir=/usr/local/lib \
--with-gettext \
--with-jpeg-dir=/usr/local/lib \
--with-kerberos \
--with-mcrypt \
--with-mysql \
--with-pear \
--with-png-dir=/usr/local/lib \
--with-xml \
--with-zlib \
--with-zlib-dir=/usr/local/lib \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-track-vars \
--with-imap=/usr/local/imap-2000e
It is at the top of the configure.php file.
8) Recompile PHP. Go to
/usr/local/directadmin/customapache and type:
./build php Do not rebuild the stuff that PHP uses; it's allready on your system and doesn't need recompiling.
9) Restart the Apache Web Server (from the DirectAdmin Control Panel, or
/etc/init.d/httpd restart).
I know that this could be done nicer if you place the entire process of installing the c-client to your server in the build file. But since you have to do some copying and renaming in the c-client libraries (see point 6) I did it the way I mentioned above.
Well, this small HOWTO should enable everyone to install IMAP support in PHP.
You can use the phpinfo() command to see if it all worked.
And euh... Don't blame me if you brake your server.
Should be pretty safe though!
Tino