FransVanNispen
Verified User
- Joined
- Oct 14, 2005
- Messages
- 19
Given the time I have spend solving this problem and all posts I have seen from people with similar problems, still unsolved, I figured a small post on this here might be appreciated.
The two typical errors:
1. configure: error: Cannot find imap library (libc-client.a). Please check your IMAP installation.
2. Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )
The problem seems to be caused by mixture of 32bit and 64bit static code, with which the linker has trouble relocating.
So, how can you fix this? Use PIC-code:
1. Make sure kereberos is installed: yum install krb5 krb5-devel
2. Install the libc-client. This must be the one from DA, as it contains small modifications for virtual accounts (as I read on this forum).
Modify the Makefile for the libc-client to use PIC-code:
Find these lines:
#EXTRACFLAGS= DA CHANGED
EXTRACFLAGS=-I/usr/kerberos/include -L/usr/kerberos/lib
And change them to (only added option -fPIC):
#EXTRACFLAGS= DA CHANGED
EXTRACFLAGS=-I/usr/kerberos/include -L/usr/kerberos/lib -fPIC
3. Modify the configure.php (or configure.php_ap2 for Apache2) file:
cd /usr/local/directadmin/customapache
vi configure.php
Remove option: --with-kerberos
Add options:
--enable-pic \
--with-libdir=lib64 \
--with-imap=/usr/local/imap-2000e
4. Compile PHP:
./build clean
./build php_ap2 n (for Apache2, for Apache1 use: ./build php n)
Now you should end up with a working PHP+IMAP. Just need to restart Apache to load the new version:
/sbin/service httpd restart (or restart from DA)
The two typical errors:
1. configure: error: Cannot find imap library (libc-client.a). Please check your IMAP installation.
2. Check the path given to --with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )
The problem seems to be caused by mixture of 32bit and 64bit static code, with which the linker has trouble relocating.
So, how can you fix this? Use PIC-code:
1. Make sure kereberos is installed: yum install krb5 krb5-devel
2. Install the libc-client. This must be the one from DA, as it contains small modifications for virtual accounts (as I read on this forum).
Code:
cd /usr/local/directadmin/customapache
wget http://files.directadmin.com/services/da_imap-2004g.tar.gz
tar -zxvf da_imap-2004g.tar.gz
cd imap-2004g
Modify the Makefile for the libc-client to use PIC-code:
Find these lines:
#EXTRACFLAGS= DA CHANGED
EXTRACFLAGS=-I/usr/kerberos/include -L/usr/kerberos/lib
And change them to (only added option -fPIC):
#EXTRACFLAGS= DA CHANGED
EXTRACFLAGS=-I/usr/kerberos/include -L/usr/kerberos/lib -fPIC
Code:
./buildit
cd c-client
mkdir /usr/local/imap-2004g/
mkdir /usr/local/imap-2004g/lib
mkdir /usr/local/imap-2004g/include
cp *.h /usr/local/imap-2004g/include
cp *.c /usr/local/imap-2004g/lib
cp c-client.a /usr/local/imap-2004g/lib
mv /usr/local/imap-2004g/lib/c-client.a /usr/local/imap-2004g/lib/libc-client.a
3. Modify the configure.php (or configure.php_ap2 for Apache2) file:
cd /usr/local/directadmin/customapache
vi configure.php
Remove option: --with-kerberos
Add options:
--enable-pic \
--with-libdir=lib64 \
--with-imap=/usr/local/imap-2000e
4. Compile PHP:
./build clean
./build php_ap2 n (for Apache2, for Apache1 use: ./build php n)
Now you should end up with a working PHP+IMAP. Just need to restart Apache to load the new version:
/sbin/service httpd restart (or restart from DA)