centos6.5 compiling and installing php[finishing A]

Source: Internet
Author: User
Tags gettext intl soap ldap php source code

    • PHP Source code
    • Http://cn2.php.net/get/php-5.4.45.tar.gz/from/this/mirror
    • Http://cn2.php.net/get/php-5.4.36.tar.gz/from/this/mirror
    • Http://cn2.php.net/get/php-5.5.31.tar.gz/from/this/mirror
    • Http://kr1.php.net/get/php-5.5.38.tar.gz/from/this/mirror
    • Http://kr1.php.net/get/php-5.6.30.tar.gz/from/this/mirror
    • Http://cn2.php.net/get/php-7.0.2.tar.gz/from/this/mirror
    • Http://kr1.php.net/get/php-7.0.6.tar.gz/from/this/mirror
    • Http://kr1.php.net/get/php-7.0.18.tar.gz/from/this/mirror
    • Http://cn2.php.net/get/php-7.1.10.tar.gz/from/this/mirror
    • #php
    • http://windows.php.net/downloads/releases/archives/
    • http://blog.itpub.net/7607759/viewspace-712351/

  

#添加组groupadd www

#添加php-FPM Users

Useradd-c php-fpm-user-g www-m php-fpm

# C and C + + compilers

Yum install-y gcc gcc-c++

# PHP Extension Dependent

Yum Install-y OpenSSL openssl-devel\

Libcurl-devel\

GD gd-devel libjpeg libjpeg-devel libpng libpng-devel\

FreeType freetype-devel\

Libpng-devel libicu-devel\

Openldap-devel\

Autoconf automake\

LIBXML2 libxml2-devel\

Pcre-devel Curl-devel zlib-devel\

Ncurses-devel

  ########################## #编译参数之一 ###################################

  

./configure--prefix=/data/soft/php\
--with-libdir=lib64\
--enable-fpm\
--with-fpm-user=php-fpm\
--with-fpm-group=www\
--enable-mysqlnd\
--with-mysql=mysqlnd\
--with-mysqli=mysqlnd\
--with-pdo-mysql=mysqlnd\
--enable-opcache\
--enable-pcntl\
--enable-mbstring\
--enable-soap\
--enable-sockets\
--enable-zip\
--enable-calendar\
--enable-bcmath\
--enable-exif\
--enable-ftp\
--enable-intl\
--with-openssl\
--with-zlib\
--with-curl\
--with-gd\
--with-zlib-dir=/usr/lib\
--with-png-dir=/usr/lib\
--with-jpeg-dir=/usr/lib\
--with-gettext\
--with-mhash\
--with-ldap

############

--ENABLE-GD-NATIVE-TTF \

########################## #编译参数之选择三 ##################################


./configure--prefix=/usr/local/php7182\
--with-config-file-path=/usr/local/php7182/etc\
--enable-mysqlnd\
--with-mysqli=mysqlnd\
--with-pdo-mysql=mysqlnd\
--enable-sockets\
--enable-soap\
--enable-pcntl\
--enable-soap\
--enable-sockets\
--with-openssl\
--with-curl\
--enable-mbstring\
--enable-mysqlnd\
--enable-fpm\
--enable-bcmath\
--with-xmlrpc\
--with-zlib\
--with-pear\
--with-gd \
--with-iconv \
--enable-xml \
--enable-bcmath \
--enable-opcache \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--ENABLE-GD-NATIVE-TTF \
--with-mcrypt=/usr/local/libmcrypt

Compile some follow-up work
# set PHP-FPM boot auto start
chmod +x/etc/init.d/php-fpm
Chkconfig PHP-FPM on
Cp/data/soft/php/etc/php-fpm.conf.default/data/soft/php/etc/php-fpm.conf
Service PHP-FPM Start

Note that Opcache >=php5.5 only supports

#修改环境变量 VI ~./bash_profile

Enable-opcache
PHP compiles bytecode caches, and if you need to use the Xdebug extension with Opcache, you must load the Opcache extension before the Xdebug extension

Use the following configuration to make PHP Live better performance
opcache.memory_consumption=128
Opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
Opcache.revalidate_freq=60
Opcache.fast_shutdown=1
Opcache.enable_cli=1

Enable-soap Simple Object Access Protocol, which uses XML to transmit data, is no longer commonly used
Enable-zip zip file processing
Enable-calendar Calendar Processing
Enable-bcmath arbitrary precision Mathematical Expansion
Enable-exif
EXIF (exchangeable image File format), specially for digital camera and photo settings, recording the property information and shooting data of digital photos

#####################

Windows users must enable Php_mbstring.dll and Php_exif.dll extensions in php.ini. Be sure to keep the correct order in php.ini:
Php_mbstring.dll must be loaded before php_exif.dll.

Enable-intl Internationalization Support
Enable-mbstring Wide character support
With-gettext language Translation
With-mhash Hash Library Support
With-ldap LDAP Support
With-libdir=lib64 if the 64-bit operating system is specified as/usr/lib64 as the default library path

centos6.5 compiling and installing php[finishing A]

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.