工作记录,方便查询:

 

需要的软件包

freetype-2.4.8.tar.gz 

libpng-1.5.9.tar.gz

jpegsrc.v6b.tar.gz  

mcrypt-2.6.8.tar.gz

gdbm-1.9.tar.gz

libevent-2.0.16-stable.tar.gz

ImageMagick-6.7.1-6.tar.gz   

memcache-3.0.6.tgz 

php-5.2.17.tar.gz

mhash-0.9.9.9.tar.gz

libiconv-1.9.2.tar.gz

imagick-3.0.1.tgz

mongo-1.2.10.tgz

 

首先安装依赖包

安装php-5.2

注意:在写with-freetype时,路径不要写全。如freetype.h的全路径如下

ls /usr/local/support/freetype/include/freetype2/freetype/freetype.h 

但如果在--with-freetype= /usr/local/support/freetype/include/freetype2/freetype时反而还会报错,只需要写-with-freetype-dir=/usr/local/support/freetype/ 就行了

 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd/bin/apxs --with-iconv-dir=/usr/local --enable-soap --enable-sockets --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl -with-freetype-dir=/usr/local/support/freetype/ --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml enable-mbstrin--with-curl --enable-mbstring

make ZEND_EXTRA_LIBS='-liconv'

安装完php-5.2后,要将编译目录下的 php.ini-production 复制到=/usr/local/php/lib/php.ini。

安装apache memcache扩展

其中Libevent需要先安装

 tar zxvf memcache-3.0.6.tgz

cd memcache-3.0.6/

/opt/local/php/bin/phpize

./configure --with-php-config=/opt/local/php/bin/php-config

make

make install

cd ../

安装mongo扩展

tar zxvf mongo-1.2.10.tgz

cd mongo-1.2.10

/opt/local/php/bin/phpize

./configure --with-php-config=/opt/local/php/bin/php-config

make

make install

cd ../

安装ImageMagick

 tar zxvf ImageMagick-6.7.1-6.tar.gz 

cd ImageMagick-6.7.1-6/

./configure

make

make install

cd ../

安装imagick扩展

tar zxvf imagick-3.0.1.tgz

cd imagick-3.0.1/

/opt/local/php/bin/phpize

./configure --with-php-config=/opt/local/php/bin/php-config

make

make install

cd ../

 

安装xdebug

#cd /root/xdebug-2.2.1/

#/usr/local/services/php5/bin/phpize

#./configure --enable-xdebug --with-php-config=/usr/local/services/php5/bin/php-config

#make

#make install

#cp modules/xdebug.so /usr/local/services/php5/lib/php/extensions/no-debug-non-zts-20060613/

#vim /usr/local/services/php5/lib/php.ini

[Xdebug]
zend_extension= /usr/local/services/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so

#/usr/local/services/apache/bin/httpd -k restart