CENTOS7 installation PHP7 The latest version of the detailed tutorial

Source: Internet
Author: User
Tags fpm gmp
This article mainly describes the CENTOS7 installation PHP7 the latest version of the detailed tutorial, one way is simple installation (through Yum), the other way is to compile the installation, the specific details of the people refer to this article, the need for friends can refer to the next

Method one, simple installation (via Yum)

1. Installing Epel-release

RPM-IVH http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

2. Installing the PHP7 rpm source

RPM-UVH https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

3. Installing PHP7

Yum Install php70w

Method Two, compile and install

1. Download PHP7

Wget-o php7.tar.gz Http://cn2.php.net/get/php-7.1.1.tar.gz/from/this/mirror

2. Unzip the PHP7

TAR-XVF php7.tar.gz

3. Go to the PHP directory

CD php-7.0.4

4. Installing dependent Packages

# Copy the following line directly (excluding bank) yum install libxml2 libxml2-devel OpenSSL openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg L Ibjpeg-devel libpng libpng-devel freetype freetype-devel GMP gmp-devel libmcrypt libmcrypt-devel readline readline-devel Libxslt Libxslt-devel

5. Compile the configuration (if there is an error, basic is the previous step of the dependent file is not installed)

It's too much trouble. Refer to PHP official installation instructions from this step: http://php.net/manual/zh/install.unix.nginx.php

./configure \--prefix=/usr/local/php \--with-config-file-path=/etc \--enable-fpm \--with-fpm-user=nginx \-- With-fpm-group=nginx \--enable-inline-optimization \--disable-debug \--disable-rpath \--enable-shared \-- Enable-soap \--with-libxml-dir \--with-xmlrpc \--with-openssl \--with-mcrypt \--with-mhash \--with-pcre-regex \-- With-sqlite3 \--with-zlib \--enable-bcmath \--with-iconv \--with-bz2 \--enable-calendar \--with-curl \--with-cdb \-- Enable-dom \--enable-exif \--enable-fileinfo \--enable-filter \--with-pcre-dir \--enable-ftp \--with-gd \-- With-openssl-dir \--with-jpeg-dir \--with-png-dir \--with-zlib-dir \--with-freetype-dir \--enable-gd-native-ttf \-- Enable-gd-jis-conv \--with-gettext \--with-gmp \--with-mhash \--enable-json \--enable-mbstring \--enable-mbregex \-- Enable-mbregex-backtrack \--WITH-LIBMBFL \--with-onig \--enable-pdo \--with-mysqli=mysqlnd \--with-pdo-mysql= Mysqlnd \--with-zlib-dir \--with-pdo-sqlite \--with-readline \--enable-session \--enable-shmop \--enable-simplexML \--enable-sockets \--enable-sysvmsg \--enable-sysvsem \--enable-sysvshm \--enable-wddx \--with-libxml-dir \-- With-xsl \--enable-zip \--enable-mysqlnd-compression-support \--with-pear \--enable-opcache

6. Formal Installation

Make && make install

7. Configure Environment variables

Vi/etc/profile

Append at end

Path= $PATH:/usr/local/php/binexport PATH

Execute commands to make changes effective immediately

Source/etc/profile

8. Configure PHP-FPM

CP PHP.INI-PRODUCTION/ETC/PHP.INICP/USR/LOCAL/PHP/ETC/PHP-FPM.CONF.DEFAULT/USR/LOCAL/PHP/ETC/PHP-FPM.CONFCP/USR /LOCAL/PHP/ETC/PHP-FPM.D/WWW.CONF.DEFAULT/USR/LOCAL/PHP/ETC/PHP-FPM.D/WWW.CONFCP sapi/fpm/init.d.php-fpm/etc/ Init.d/php-fpmchmod +X/ETC/INIT.D/PHP-FPM

9. Start PHP-FPM

/ETC/INIT.D/PHP-FPM start

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.