sloop
Verified User
problem: on centos, the libc-client package is compiled with a low "FD_SETSIZE" limit (I assume 256). when adding imap support to php, compiling against the default libc-client RPMs, this will cause Apache to segfault if Apache has over 256 open file descriptors. All active apache logs count against this limit so its easy to hit on a shared hosting server.
solution: download latest imap c-client and compile from scratch:
download and extract
edit source files
edit src/osdep/unix/os_art.c and src/osdep/unix/os_sv2.c in an editor,
find this:
change it to:
openssl symlink
you should already have openssl and openssl-dev packages installed, but no /usr/local/ssl directory. run:
compile imap c-client
put files where php wants
recompile php
if you don't already have a custom configure.php;
add these lines to your custom/ap2/configure.php5 file:
now run ./build php n
now your phpinfo() should show IMAP c-Client Version = 2007f
solution: download latest imap c-client and compile from scratch:
download and extract
Code:
cd /usr/local
wget ftp://ftp.cac.washington.edu/imap/c-client.tar.Z
tar xvfz c-client.tar.Z
cd imap-2007f
edit source files
edit src/osdep/unix/os_art.c and src/osdep/unix/os_sv2.c in an editor,
find this:
Code:
#define FD_SETSIZE 256
change it to:
Code:
#define FD_SETSIZE 32768
openssl symlink
you should already have openssl and openssl-dev packages installed, but no /usr/local/ssl directory. run:
Code:
ln -s /usr/lib64/openssl/engines/ /usr/local/ssl
ln -s /usr/include/ /usr/local/ssl/include
compile imap c-client
Code:
make lnp SSLTYPE=unix EXTRACFLAGS=-fPIC
put files where php wants
Code:
mkdir lib
mkdir include
cp c-client/*.c lib/
cp c-client/*.h include/
cp c-client/c-client.a lib/libc-client.a
recompile php
Code:
cd /usr/local/directadmin/custombuild
if you don't already have a custom configure.php;
Code:
mkdir -p custom/ap2
cp configure/ap2/configure.php5 custom/ap2
add these lines to your custom/ap2/configure.php5 file:
Code:
--with-imap=/usr/local/imap-2007f \
--with-imap-ssl \
now run ./build php n
now your phpinfo() should show IMAP c-Client Version = 2007f
Last edited: