本文共 586 字,大约阅读时间需要 1 分钟。
## centos安装编译环境 yum groupinstall 'Development Tools' 和你系统php版本对应的源码目录 /root/sources/php-5.3.26 #################################################### 上边两步都已完成。 #################################################### /root/sources/php-5.3.26 下面,ext子目录 是php各扩展的目录。 比如安装php-gd扩展 转到 ext/gd 目录下 cd ext/gd 执行如下命令 ## 安装 gd-devel 开发包 编译需要其它的扩展,如mysql扩展 对应mysql-devel ## 编译mysqli扩展同需要 mysql-devel 等等 yum install gd-devel ## 配置扩展编译脚本 生成configure /usr/local/bin/phpize ./ ## 检查编译环境 ./configure ## 编译 make ## 安装 make install 编辑php配置文件 /usr/local/lib/php.ini 找到 extension 区块,增加新行(具体看这个文件) extension=gd.so 转载地址:http://xpcli.baihongyu.com/