PHP install, phpinstall

Source: Internet
Author: User

PHP install, phpinstall

PHP7 integrates Fastcgi

The startup Item is changed to php-fpm.

First, install the dependent libraries required by php.

yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-defel libxml2 libxml2-devel pcre-devel curl-devel libxslt-devel

 

 

// Download php

 wget http://php.net/distributions/php-7.0.23.tar.xz   

 

 

// Extract

 xz -d php-7.0.23.tar.xz

 

// Unpack

tar xvf php-7.0.23.tarcd php-7.0.23

 

 

// Compile-detailed configuration options are explained in google Baidu queries

# ./configure --prefix=/usr/local/php \ --sbin-path=/usr/sbin/php \ --bin-path=/usr/bin/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

 

 

Note: "Pay attention to any errors or missing dependency packages during configuration. If yes, add them on your own"

 

Compile and install

make&&make install

 

 

 

 

Configuration File cp

// Reference file of php-fpm

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

 

// Move php-fpm startup to init. d boot start

cp -R ./sapi/fpm/php-fpm   /etc/init.d/php-fpm    

 

 

# Php-v is OK when the following prompt appears

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.