php7.04 编译安装

安装参考:http://www.tuicool.com/articles/bi2iYj3

编译参数:

./configure
--prefix=/usr/local/php7
--exec-prefix=/usr/local/php7
--bindir=/usr/local/php7/bin
--sbindir=/usr/local/php7/sbin
--includedir=/usr/local/php7/include
--libdir=/usr/local/php7/lib/php
--mandir=/usr/local/php7/php/man
--with-config-file-path=/usr/local/php7/etc
--with-mysql-sock=/var/run/mysql/mysql.sock
--with-mcrypt=/usr/include
--with-mhash
--with-openssl
--with-mysqli=shared,mysqlnd
--with-pdo-mysql=shared,mysqlnd
--with-gd
--with-iconv
--with-zlib
--enable-zip
--enable-inline-optimization
--disable-debug
--disable-rpath
--enable-shared
--enable-xml
--enable-bcmath
--enable-shmop
--enable-sysvsem
--enable-mbregex
--enable-mbstring
--enable-ftp
--enable-gd-native-ttf
--enable-pcntl
--enable-sockets
--with-xmlrpc
--enable-soap
--without-pear
--with-gettext
--enable-session
--with-curl
--with-jpeg-dir
--with-freetype-dir
--enable-opcache
--enable-fpm
--with-fpm-user=nginx
--with-fpm-group=nginx
--without-gdbm 
--disable-fileinfo

 

要把 编译参数弄成一行再执行

编译如果报错,使用 ./configure –help 查看哪些参数是能用的,每个版本可能都不一样

使用 apache 还需要添加参数 –with-apxs2=/usr/sbin/apxs