PHP7 源码编译安装

PHP7被赋予众望,相信很多phper都很期待它能早日面世,鸟哥也在博客对比了hhvm性能,废话少说,自己本地装一个对比下性能

1.下载源代码

wget http://cn2.php.net/distributions/php-7.0.5.tar.gz 

2.安装mcrypt库

wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
tar xzvf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure --prefix=/opt/libmcrypt
&& make install 

3. 编译参数

./buildconf
./configure --prefix=/opt/php7 --with-config-file-path=/opt/php7/etc --with-mcrypt=/opt/libmcrypt --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gd --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-opcache

4. make 
5. sudo make install

6.其他配置

sudo cp php.ini-production /opt/php7/etc/php.ini
sudo cp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpm
sudo cp /opt/php7/etc/php-fpm.conf.default /opt/php7/etc/php-fpm.conf
sudo cp /opt/php7/etc/php-fpm.d/www.conf.default /opt/php7/etc/php-fpm.d/www.conf

7.启动php-fpm

sudo chmod u+x /etc/init.d/php7-fpm
/etc/init.d/php7-fpm start

发表评论

邮箱地址不会被公开。 必填项已用*标注