php fpm 编译安装,编译安装php with php-fpm

php5.2

./configure --prefix=/usr/local/php-5.2.14 -with-config-file-path=/usr/local/php-5.2.14/etc -with-mysql=/usr/bin/mysql -with-mysqli=/usr/bin/mysql_config -with-openssl -enable-fpm -enable-mbstring -with-freetype-dir -with-jpeg-dir -with-png-dir -with-zlib-dir -with-libxml-dir=/usr -enable-xml -with-mhash -with-mcrypt -enable-pcntl -enable-sockets -with-bz2 -with-curl -with-curlwrappers -enable-mbregex -with-gd -enable-gd-native-ttf -enable-zip -enable-soap -with-iconv -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -with-ldap -with-ldap-sasl -enable-pdo -with-pdo-mysql -enable-force-cgi-redirect -enable-cgi -with-libdir=lib64 -enable-fastcgi

php-fpm 需要--enable-cgi --enable-fpm 两个参数,上面参数的顺序也很重要,否则configure过不去。

如果是64位系统configure需要加上参数--with-libdir=lib64,否则很可能会缺少库文件,例如:

php configure error libjpeg.(a so) not found

编译链接的时候可能出现问题,比如 /usr/bin/ld: cannot find -lltld,缺少/usr/lib/libltdl.so,添加epel源,yum install libtool-ltdl-devel就可以了,之后make clean重新编译就OK了。

这种方式安装的扩展都是集成到php.exe中的。

php5.4

./configure --prefix=/opt/local/php-5.4.44 -with-config-file-path=/opt/local/php-5.4.44/etc -with-mysql=mysqlnd -with-mysqli=mysqlnd -enable-ftp -with-openssl -enable-fpm -enable-mbstring -with-freetype-dir -with-jpeg-dir -with-png-dir -with-zlib-dir -with-libxml-dir=/usr -enable-xml -with-mhash -with-mcrypt -enable-pcntl -enable-sockets -with-bz2 -with-curl -with-curlwrappers -enable-mbregex -with-gd -enable-gd-native-ttf -with-gettext -enable-zip -enable-soap -with-iconv -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -with-ldap -with-ldap-sasl -enable-pdo -with-pdo-mysql -enable-cgi -with-libdir=lib64

zts版本增加 --enable-maintainer-zts

依赖库:

yum install libxml2-devel openssl-devel bzip2-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel openldap-devel libmcrypt-devel mhash-devel mysql-devel libtool-ltdl-devel

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值