LAMP:安装php的扩展模块

以GD为例:安装gd图像处理库
查看php中已安装过的模块:
[[email protected] /]# php -m
1、安装相应的依赖程序。
[[email protected] /]# yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gd libxml2-devel
2、进入到源码包中找到gd
[[email protected] /]# cd /usr/src/php-5.3.28/ext/gd/
3、执行phpize,
[[email protected] gd]# phpize
LAMP:安装php的扩展模块
4、配置、编译、安装
[[email protected] gd]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-png-dir --with-freetype-dir --with-jpeg-dir --with-gd
[[email protected] gd]# make && make install
5、查看生成的镜像文件
[[email protected] gd]# cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
LAMP:安装php的扩展模块
6、修改php.ini
[[email protected] /]# vim /usr/local/php/php.ini
extension=gd.so
7、重新启动服务
[[email protected] /]# service php-fpm restart
8、查看是否安装成功
LAMP:安装php的扩展模块