Chinaunix首页 | 论坛 | 博客
  • 博客访问: 228395
  • 博文数量: 57
  • 博客积分: 1149
  • 博客等级: 少尉
  • 技术积分: 584
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-29 11:35
文章分类

全部博文(57)

文章存档

2016年(1)

2014年(1)

2013年(2)

2012年(27)

2011年(26)

分类: LINUX

2011-11-08 10:45:23

imap

yum  install openssl-devel

yum install pam-devel

yum install libc-client libc-client-devel

yum install libcurl*

wget  

tar zxf imap.tar.Z

cd imap-2007f

make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd IP6=4

mkdir /usr/local/imap-2007f

mkdir /usr/local/imap-2007f/include/

mkdir /usr/local/imap-2007f/lib/

chmod -R 077 /usr/local/imap-2007f

cp imapd/imapd /usr/sbin/

cp c-client/*.h /usr/local/imap-2007f/include/

cp c-client/*.c /usr/local/imap-2007f/lib/

cp c-client/c-client.a /usr/local/imap-2007f/lib/libc-client.a

 

 

重新编译php  

'--with-imap-ssl' \

'--with-imap=/usr/local/imap-2007f' \

'--enable-zip' \

'--with-curl' \

 

 




64位:

imap安装包下面编辑Makefile

 

找到

EXTRACFLAGS=

改为:

EXTRACFLAGS=-I/usr/kerberos/include -L/usr/kerberos/lib -fPIC

 

make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd IP6=4

mkdir /usr/local/imap-2007f

mkdir /usr/local/imap-2007f/include/

mkdir /usr/local/imap-2007f/lib/

chmod -R 077 /usr/local/imap-2007f

cp imapd/imapd /usr/sbin/

cp c-client/*.h /usr/local/imap-2007f/include/

cp c-client/*.c /usr/local/imap-2007f/lib/

cp c-client/c-client.a /usr/local/imap-2007f/lib/libc-client.a

 

 

phpconfig.nice加入--with-kerberos

就可以继续编译php支持imap模块了

 

原文:

PHP + IMAP on 64Bit machines

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).

 

Code:

cd /usr/local/directadmin/customapache
wget

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)

 

源文档 <>

 

 

阅读(4674) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~