Comparison of PHP7 and HHVM
The performance of PHP7 in real-world scenes has indeed been comparable to that of HHVM, in some cases even exceeding the HHVM. HHVM is a multithreaded model, which means that if a thread causes crash, the entire service is hung up and it does not restart automatically. In addition, it uses the JIT, which means that after the restart to warm up, without preheating the situation, the performance is worse. and multithreaded model debugging difficult, which for the pursuit of stable web services, is very unsuitable.
Nginx and PHP7.0 Prior versions can refer to this article: installation and commissioning of Linux environment Nginx and PHP installation
PHP7.0 official version has been released around November 2015, is currently the PHP7.0.2 version, I was the earliest from August 2015 PHP7 The first beta version, and now the official version released.
Linux version: 64-bit CentOS 6.6
Nginx Version: nginx1.8.0
PHP Version: php-7.0.2
Download
Http://php.net/get/php-7.1.8.tar.gz/from/a/mirror
We recommend that you check the installation Help file before installing
Unzip the installation
# tar zxvf php-7.1.8.tar.gz# CD php-7.1.8
First look at the installation Help
#./configure --help#./configure--prefix=/usr/local/php --with-curl --with-freetype-dir -- WITH-GD --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 -- With-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql -- With-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --ENABLE-FPM --enable-bcmath --enable-libxml --enable-inline-optimization -- Enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml -- Enable-zip
May encounter error about--with-xsl module, delete--with-xsl \ re-execute again
If the configuration is wrong, the required modules need to be installed and the dependent libraries will be installed directly with Yum
# yum-y Install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel MySQL pcre-devel
Note: When installing PHP7BETA3, there are several configurations that need Yum, and now php-7.1.8 is no longer necessary. # yum-y installed curl-devel# yum-y install libxslt-devel compile installation # make && make install
configuration file
# CP php.ini-development/usr/local/php/lib/php.ini# cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/ php-fpm.conf# cp/usr/local/php/etc/php-fpm.d/www.conf.default/usr/local/php/etc/php-fpm.d/www.conf# cp-r./sapi/ fpm/php-fpm/etc/init.d/php-fpm
Note that PHP7 www.conf This configuration file configuration phpfpm port number, and so on, if you modify the default 9000 port number should be changed here, and then change the Nginx configuration
Start
#/ETC/INIT.D/PHP-FPM View Phpinfo () excerpt from: http://blog.csdn.net/21aspnet/article/details/47708763 http://blog.csdn.ne t/unix21/article/details/8544922
Linux Environment PHP5.6 Upgrade 7.1.8