CentOS 6.5 x64 Install PHP 7

Source: Internet
Author: User
Tags install php

Create users and Groups

Groupadd www

Useradd-g www www

Usermod-s/sbin/nologin www


Installing components

Yum install-y libxml2 libxml2-devel Libxml2-python Curl curl-devel libjpeg libjpeg-devel libpng libpng10 libpng10-devel Libpng-devel freetype-devel libmcrypt libmcrypt-devel gd gd-devel

Clean up the cache

Yum Clean All


Download latest Version php-7.0.6

Extract

Tar zxvf php-7.0.6.tar.gz-c/usr/src/

cd/usr/src/php-7.0.6/

./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc \

--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib \

--with-libxml-dir--enable-xml--enable-bcmath \

--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl \

--enable-mbregex--enable-fpm--enable-mbstring \

--with-mcrypt--with-gd--enable-gd-native-ttf--with-openssl--with-mhash \

--enable-pcntl--enable-sockets \

--with-xmlrpc--enable-zip--enable-soap--with-mysql-sock=/data/3306/mysqld.sock \

--WITH-CURL=/USR--with-gettext--with-iconv--enable-mysqlnd \

--WITH-MYSQLI=MYSQLND \

--WITH-PDO-MYSQL=MYSQLND \

Installation

Make

Make install


++++++++++++++++++++++++++++++++++++++

In particular, PHP7 officially removed the MySQL extension

Using the Mysqlnd driver

If you continue to use the old version of the compilation method

--with-mysql=/usr/local/mysql--enable-embedded-mysqli--with-mysqli=/usr/local/mysql/bin/mysql_config

Error when make is on

Make: * * * [Ext/mysqli/mysqli_embedded.lo] Error 1


So I changed to

--enable-mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd

Before it can be compiled successfully

+++++++++++++++++++++++++++++++++++++++++


Copying configuration files and startup scripts

CP Php.ini-production/usr/local/php/etc/php.ini

Cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf

CP SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM

Cp/usr/local/php/etc/php-fpm.d/www.conf.default/usr/local/php/etc/php-fpm.d/www.conf

Cd/usr/local/php/etc/php-fpm.d

Editing a configuration file

VI www.conf

Modify users and groups for www


user = www

Group = www


Scripts to set permissions, add to boot from boot

chmod +x/etc/init.d/php-fpm

Chkconfig--add PHP-FPM

Chkconfig--level 2345 PHP-FPM on

Start PHP-FPM

/ETC/INIT.D/PHP-FPM start

To see if the port is started

NETSTAT-ANPT | grep php-fpm


TCP 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 25727/php-fpm




This article is from the "Falling Star" blog, make sure to keep this source http://xiao987334176.blog.51cto.com/2202382/1783804

CentOS 6.5 x64 Install PHP 7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.