650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7E/9E/wKioL1cF2K2gFP4bAAAuWCc-_aE698.jpg "title=" Php7.jpg "alt=" Wkiol1cf2k2gfp4baaauwcc-_ae698.jpg "/>
Environment Introduction:
System version: RHEL 6
Software Warehouse: Yum-base,yum-epel
PHP Version: PHP 7.0.5
Installation Method: Source code compilation
Delete the original Yum installed version of PHP
# yum Remove php-y# yum remove php-*-y
2. Install the package and dependent environment
# yum-y Install libxml2 libxml2-devel OpenSSL openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcryp T-devel
3. Create a running user
# useradd-r-m-s/sbin/nologin php
4. Download PHP 7 source package, PHP official download page http://php.net/downloads.php
# Wget-o php-7.0.5.tar.gz Http://cn2.php.net/get/php-7.0.5.tar.gz/from/this/mirror
5. Compiling and installing PHP 7
# Tar XF php-7.0.5.tar.gz# cd php-7.0.5/#./configure--prefix=/usr/local/php_7.0.5--datarootdir=/usr/share-- ENABLE-FPM--with-fpm-user=php--with-fpm-group=php--with-curl--with-mysqli=/usr/local/mysql5.6.26/bin/mysql_ Config--with-mysql-sock=/var/lib/mysql/mysql.sock--with-readline--with-snmp--enable-soap--with-pear-- with-pdo-mysql=/usr/local/mysql5.6.26
Since I have compiled and installed MySQL 5.6, it is necessary to manually specify MYSQLI related paths.
# MAKE-J 4 && make install
6. Test PHP
#/usr/local/php-7.0.5/bin/php-v
7. Configure PHP-FPM
Since I used PHP-FPM to handle back-end PHP requests, we need to configure PHP-FPM
Enter PHP source directory, Copy service startup script # CP sapi/fpm/init.d.php-fpm/etc/init.d/php-fpm# chmod +x/etc/init.d/php-fpm# chkconfig--add php-fpm
Edit php-fpm config file # cp/usr/local/php_7.0.5/etc/php-fpm.conf.default/usr/local/php_7.0.5/etc/php-fpm.conf# mv/usr/ local/php_7.0.5/etc/php-fpm.d/www.conf.default/usr/local/php_7.0.5/etc/php-fpm.d/# Service PHP-FPM Start
8. Test whether the PHP-MYSQLI is working properly
# php-a> $db = new mysqli (' localhost ', ' MySQL ', ' root ', ');
If you do not get an error, then there should be no problem.
This article is from the "Professor" blog, please be sure to keep this source http://professor.blog.51cto.com/996189/1761243
CentOS 6 Source code compilation install PHP 7.0.5