PHP compilation Installation Series Daquan

Source: Internet
Author: User
Tags fpm gettext pear php and mysql snmp tidy zend aliyun

PHP Compilation Installation Series

Xu Liangwei, Hu Hu called the benchmark Xu. Years of experience in Internet operation and maintenance, has been responsible for large-scale cluster architecture automation operation and maintenance management. Good at Web cluster architecture and automation operations, has been responsible for a large-scale domestic electrical Shang work.
The personal blog "Xu Liangwei Architect's Road" has benefited tens of thousands of people in total.
Author q:552408925, 572891887
Architect Group: 471443208

PHP5.6 Compiling and installing
Wget-o/etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-6.repoyum Install Zlib-devel libxml2-devel Libjpeg-devel libjpeg-turbo-devel Libiconv-devel-yyum Install freetype-devel libpng-devel gd-devel libcurl-devel Libxslt-devel-yyum-y Install libmcrypt-devel mhash mcryptmkdir-p/soft/package/srccd/soft/package/srctar zxf php-5.6. 23.tar.gz CD php-5.6.23./configure--prefix=/soft/php-fastcgi5.6.23--with-pdo-mysql=mysqlnd--with-mysqli=mysqlnd- -with-mysql=mysqlnd--with-jpeg-dir--with-png-dir--with-zlib--enable-xml--with-libxml-dir--with-curl-- Enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--enable-mbregex--with-openssl-- Enable-mbstring--with-gd--enable-gd-native-ttf--with-freetype-dir=/usr/lib64--with-gettext=/usr/lib64-- Enable-sockets--with-xmlrpc--enable-zip--enable-soap--disable-debug--enable-opcache--enable-zip-- With-config-file-path=/usr/local/php-fastcgi/etc--enable-fpm--with-fpm-user=www--with-fpm-group=wwwmaKe && make install memory is less than one G, plus at the end. --disable-fileinfocd/application/tools/php/ext/application/php/bin/phpize./configure--with-php-config=/ Application/php/bin/php-config--with-pdo-mysql=/application/mysqlmake && make install
PHP5.5 Compiling and installing
Wget-o/etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-6.repoyum Install Zlib-devel libxml2-devel Libjpeg-devel libjpeg-turbo-devel Libiconv-devel-yyum Install freetype-devel libpng-devel gd-devel libcurl-devel Libxslt-devel-yyum-y Install libmcrypt-devel mhash mcryptmkdir-p/soft/package/srccd/soft/package/srcwget http://ftp . Gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gztar zxf LIBICONV-1.14.TAR.GZCD libiconv-1.14./configure--prefix=/ Usr/local/libiconvmakemake INSTALLCD. /cd/soft/package/srctar XF php-5.5.38.tar.gzcd php-5.5.38./configure--prefix=/soft/php5.5.38--with-mysql=mysql-- With-iconv-dir=/usr/local/libiconv--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir =/USR--enable-xml--disable-rpath--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--enable-short-tags--enable-static--with-xsl--with-fpm-user= www--with-fpm-group=www--enable-ftp--enable-opcache && make && make Installln-s/soft/mysql/lib/ Libmysqlclient.so.18/usr/lib64/touch Ext/phar/phar.phar make && make installln-s/soft/php5.5.38//SOFT/PHPCP /soft/src/php-5.5.38/php.ini-production/soft/php/lib/php.inicp/soft/php/etc/php-fpm.conf.default/soft/php/etc/ php-fpm.conf/soft/php/sbin/php-fpm//if you need to separate PHP from MySQL--with-pdo-mysql=mysqlnd--with-mysqli=mysqlnd- With-mysql=mysqlnd
PHP5.3 Compiling and installing
Wget-o/etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-6.repoyum Install Zlib-devel libxml2-devel Libjpeg-devel libjpeg-turbo-devel Libiconv-devel-yyum Install freetype-devel libpng-devel gd-devel libcurl-devel Libxslt-devel-yyum-y Install libmcrypt-devel mhash mcryptmkdir-p/soft/package/srccd/soft/package/srcwget http://ftp . Gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gztar zxf LIBICONV-1.14.TAR.GZCD libiconv-1.14./configure--prefix=/ Usr/local/libiconvmakemake INSTALLCD. /cd/soft/package/srctar XF php-5.3.27.tar.gzcd php-5.3.27./configure--prefix=/soft/php5.3.27--with-mysql=/soft/ mysql/--with-iconv-dir=/usr/local/libiconv--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib-- WITH-LIBXML-DIR=/USR--enable-xml--disable-rpath--enable-safe-mode--enable-bcmath--enable-shmop--enable-sysvsem --enable-inline-optimization--with-curl--with-curlwrappers--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--enable-short-tags- -enable-zend-multibyte--enable-static--with-xsl--with-fpm-user=www--with-fpm-group=www--enable-ftpln-s/soft/ Mysql/lib/libmysqlclient.so.18/usr/lib64/touch Ext/phar/phar.phar make && make installln-s/soft/php5.3.27// soft/phpcp/soft/package/src/php-5.3.27/php.ini-production/soft/php/lib/php.inicp/soft/php/etc/ php-fpm.conf.default/soft/php/etc/php-fpm.conf/soft/php/sbin/php-fpm//php5.3 compilation parameters [[email protected] Tools ]# Tar XF php-5.3.27.tar.gz decompression Pack [[email protected] tools]# CD php-5.3.27 into the PHP installation directory./configure compilation Parameters--prefix=/soft/ PHP5.3.27 specifies that the installation path for PHP/soft/php5.3.27--with-mysql=/soft/mysql/needs to specify the installation path for MySQL, and installs the MySQL-related content required by PHP. Of course, MySQL standalone installation is recommended to use--WITH-MYSQL=MYSQLND instead of--with-mysql=/soft/mysql, which takes PHP and MySQL apart. --with-iconv-dir=/usr/local/libiconv Libiconv Library, conversion between various character sets--with-freetype-dir open to FreeType font library support--with-jpeg-dir Turn on support for JPEG pictures--with-png-dir OpenSupport for PNG images--with-zlib Open zlib Library support for HTTP compressed transport--WITH-LIBXML-DIR=/USR open LIBXML2 Library support--enable-xml--disable-rpath Close additional Runtime files--enable-safe-mode Open Safe Mode--enable-bcmath turn on picture resizing and use Zabbix to monitor the module--enable-shmop--enable-sysvsem With the SYSV signaling mechanism, turn on this option--enable-inline-optimization optimize threads--with-curl turn on support for the Curl browsing tool--with-curlwrappers The Ops Curl tool opens the URL stream--enable-mbregex--enable-mbstring supports the Mbstring--with-mcrypt encoding function library--WITH-GD Support for opening GD library--enable-gd-native-ttf supports TrueType string library--with-openssl OpenSSL support,--with-mhash for encrypted transmissions The extension of the Mhash algorithm--enable-pcntl FreeTDS needs to be used, may be link mssql--enable-sockets open sockets support--WITH-XMLRPC Open Xml-rpc's C language--enable-zip open support for zip--enable-soap soap Module extension--enable-short-tags start and tag functions--enable-zend-multibyte    Support for Zend Multi-byte--enable-static build static link library--with-xsl open XSLT file support, expand LibXML2 Library, need libxslt software--enable-ftp open FTP support--ENABLE-FPM Represents the activation of the PHP-FPM mode service, which is the factcgi way to run the PHP service. --WITH-FPM-USER=WWW specifies that the user of the PHP-FPM process management is WWW, the best and the Nginx service user is unified. --WITH-FPM-GROUP=WWW specifies that the PHP-FPM process Management User Group is WWW, where the best and Nginx service user groups are unified. Soft links [[email protected] PHP]# ln-s/application/mysql/lib/libmysqlclient.so.18/usr/lib64///Create PHP installation requires files [[email protected] php]# Touch ext/ Phar/phar.phar//make Build Makefile recently compiled installation [[email protected] php]# make && make install//soft link release (easy to upgrade and subsequent maintenance) [[email protected] php]# ln-s/soft/php5.3.27//soft/php//copy php.ini requires configuration file [[email protected] php]# cp/soft/ src/php-5.3.27/php.ini-production/soft/php/lib/php.ini//copy php-fpm configuration file [[email protected] php]# cp/soft/php/ etc/php-fpm.conf.default/soft/php/etc/php-fpm.conf//Start php-fpm[[email protected] php]#/soft/php/sbin/  php-fpm
PHP7 Compilation Parameters Detailed
    --prefix=/usr/local/php706//Specify PHP installation directory--enable-calendar//Turn on calendar extension function--enable-    Sysvsem//using SYSV signaling mechanism, turn this option on--ENABLE-SYSVSHM//Enable System V shared memory support.    --ENABLE-SYSVMSG//Enable SYSVMSG support.    --enable-bcmath//Turn on picture resizing, use Zabbix to monitor the module--enable-exif//Picture metadata support --ENABLE-FTP//Open FTP support--enable-mbstring//support mbstring--enable-                         SHMOP//Enable SHMOP support--enable-sockets//Open Sockets support--enable-dtrace                            Enable DTrace (dynamic tracking) to support the extension of the--enable-soap//soap module--enable-zip            Open support for zip--enable-mbregex//multibyte string function--enable-inline-optimization     /optimize thread--enable-pcntl//freetds need to use, may be link MSSQL--enable-pdo                       Data connection extension compatible with PHP interface.    --ENABLE-GD-NATIVE-TTF//Support TrueType String library--enable-opcache//open Opcache cache.                            --enable-xml//--ENABLE-MAINTAINER-ZTS/Enable thread safety-code maintainer uses--ENABLE-FPM Indicates the activation of the PHP-FPM mode service, that is factcgi run PHP service--with-iconv-dir=/usr/local/libiconv//libiconv Library, a variety of words Conversion between set of characters--with-gettext//Open GNU GetText Support, encoding library for--with-libxml-dir//Open                    Support for the LIBXML2 library--with-zlib//Open zlib Library for HTTP compressed transport--WITH-KERBEROS=/USR                            OpenSSL includes support for--with-openssl//openssl for Kerberos,--with-mhash for encrypted transmissions Extension of the Mhash algorithm--with-mysql-sock=mysql_socket//specifies the MySQL socket. If not specified, search--with-mysqli=mysqlnd//mysqli extension--with-pdo-mysql=mysqlnd by default location//pdo:mysql Support. Dir is the basic directory of MySQL, if there is no valueOr Mysqlnd as Dir, the MySQL native driver dir is the basic directory of MySQL, and if no value or Mysqlnd is passed as Dir, the MySQL native driver will be used--WITH-PDO-PGSQL=PGSQLND Enable PostgreSQL support and specify the path to its software root or pg_config (pgsql required)--with-curl//Turn on support for the Curl browsing tool--with -GD//Open GD Library support--with-xpm-dir//Specify the installation directory of GD library libxpm--with-jpeg- DIR//Open support for JPEG images--WITH-PNG-DIR//Open support for PNG images--with-freetype-d IR//open to FreeType Font Library support--WITH-XMLRPC//Open XML-RPC C language--with-fpm-user=n    Obody//Specify PHP-FPM process management user is WWW, here is the best and Nginx service user Unified.    --with-fpm-group=nobody//Specify PHP-FPM Process management user Group for WWW, best and nginx service user group Unified.    --WITH-FPM-ACL//using POSIX access control list, 5.6.5 Effective--with-mcrypt//encoding function library    --with-tsrm-pthreads//using POSIX threads (default). --disable-fileinfo//Close some running processes such as MysQLD,HTTPD and so on, to conserve memory. --disable-rpath//Close additional runtime files make zend_extra_libs= '-liconv-l/usr/local/libiconv/lib '//icon The V function library is capable of converting between various character sets, such as implementing Utf-8 and gb2312 encoding conversion make zend_extra_libs= '-liconv ' made install CP php.ini-production/usr/l Ocal/php7/etc/php.ini configure it can automatically set the source program to meet the characteristics of UNIX systems on various platforms, and generate the appropriate makefile files based on the number of systems and the environment so that the source program can be easily compiled on different platforms MA    Ke is used to compile, it reads the instruction from the makefile, and then compiles. Make install installs the program into the system. If the original code compiles correctly, and the result is correct, the program can be installed to the system preset executable file storage path.    Reads the instruction from the makefile and installs it to the specified location.    Make clean clears the resulting executable file and the target file (object FILE,*.O). Make Distclean removes the makefile generated by the Configure in addition to clearing the executable and target files. # #PHP7可选参数--WITH-XSL=SHARED,/USR//Open XSLT file support, extended libXML2 Library, need libxslt software--WITH-ZLIB-DIR=/USR// Defines the directory where the zlib installation resides (compression and archiving)--WITH-SNMP=SHARED,/USR//contains SNMP support. (SNMP simple server monitoring System)--WITH-TIDY=SHARED,/USR//Includes tidy support. (Web page code analysis and error correction tools, capable of supporting multiple page encodings and supporting XHTML output)--WITH-RECODE=SHARED,/USR//contains Recode support (Recode Library can be used in various coded character sets andConvert files between surface encodings)--WITH-PSPELL=SHARED,/USR//include Pspell support GNU (for spell checking)--WITH-GMP=SHARED,/USR//enable GNU MP support --WITH-ENCHANT=SHARED,/USR//Enable enchant support.    (abstract layer of various spelling libraries)--WITH-VPX-DIR=SHARED,/USR//GD: Specify the installation directory for LIBVPX (VP8 codec)--with-system-tzdata//Program execution function --ENABLE-INTL//Turn on internationalization support (internationalization and character encoding support)--WITH-MSSQL=SHARED,/USR//include mssql-db support, and specify FREETDS software catalog (p HP7 removed)--with-ldap=shared,/usr//ldap expansion module--WITH-LDAP-SASL=/USR//LDAP expansion module--with-unixodbc=sha             RED,/USR//contains UNIXODBC support (via ODBC link local MySQL)--disable-static//disable static Library # #php7默认, do not co-opt items--disable-debug         /Close Detailed request information (default is OFF)--BUILD=X86_64-LINUX-GNU//Specifies the system type build of the system on which the compilation tool is located--HOST=X86_64-LINUX-GNU Specifies the target system type to run when the Apache HTTP server will be cross-compiled host--localstatedir=/var//Machine Data Directory dir (var under default installation path)--mandir=/usr/sh Are/man//Manual Documentation Directory DIR (under the default installation path under Datarootdir Man directory)--disable-short-tags default disable short formType of start tag <?. --disable-libtool-lock avoid locking (may disrupt parallel builds)--disable-all Disable all extensions enabled by default--enable-shared=pkg    S//Enable build shared library by default--enable-static=pkgs//enable build static library by default--enable-fast-install = pkgs//enable quick Install after optimization by default --enable-ctype//ctype extension, enabled by default from PHP4.2.0. Disabling--with-pear=/usr/share/php//pear with--disable-ctype (implements such as destructors, error trapping) defaults to prefix/lib/php--with-apxs2=/usr/bin    /apxs2//apxs php is loaded in PHP module mode. --WITH-PCRE-REGEX=/USR//php 4.2.0 These functions are enabled by default.                --without-pcre-regex//disable Pcre function--WITH-LAYOUT=GNU//display the layout of the installation file PHP or GNU (default PHP)--with-regex=php    The Regular Expression library type (default type=php)--WITH-SQLITE3=SHARED,/USR//5.3 The default startup SQLite3 extension. --with-mysql-sock=sockpath//mysql UNIX socket pointer position. If not specified, the default location will be searched--with-odbcver=hex//The ODBC version that is enforced by the support.    The expected hexadecimal number, which defaults to 0x0300. --WITH-GNU-LD//Assuming C compiler uses GNU ld default = no--with-config-file-path=path//Sets the search path for the php.ini.      The default is Prefix/lib.            --with-fpm-user=//default Nobody user--with-fpm-group=//default nobody user group--with-tsrm-pthreads    POSIX threads are used by default. --with-pic//try to use only pic/non-pic objects, and by default use--with-apxs[=file]//Compile shared Apache module. FILE is the path to the optional Apache Apxs tool, which points to apxs by default.

PHP compilation installation series Daquan

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.