PHP5.6 Compiling and installing
Wget-o/etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-6.repo
Yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel-y
Yum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel-y
Yum-y Install Libmcrypt-devel Mhash mcrypt
Mkdir-p/SOFT/PACKAGE/SRC
Cd/soft/package/src
Tar 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=www
Make && make install
Memory is less than one G, plus at the end.
--disable-fileinfo
Cd/application/tools/php/ext
/application/php/bin/phpize
./configure--with-php-config=/application/php/bin/php-config--with-pdo-mysql=/application/mysql
Make && make install
PHP5.5 Compiling and installing
Wget-o/etc/yum.repos.d/epel.repo Http://mirrors.aliyun.com/repo/epel-6.repo
Yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel-y
Yum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel-y
Yum-y Install Libmcrypt-devel Mhash mcrypt
Mkdir-p/SOFT/PACKAGE/SRC
Cd/soft/package/src
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
Tar zxf libiconv-1.14.tar.gz
CD libiconv-1.14
./configure--prefix=/usr/local/libiconv
Make
Make install
Cd.. /
Cd/soft/package/src
Tar XF php-5.5.38.tar.gz
CD 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 install
Ln-s/soft/mysql/lib/libmysqlclient.so.18/usr/lib64/
Touch Ext/phar/phar.phar
Make && make install
Ln-s/soft/php5.5.38//soft/php
Cp/soft/src/php-5.5.38/php.ini-production/soft/php/lib/php.ini
Cp/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.repo
Yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel-y
Yum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel-y
Yum-y Install Libmcrypt-devel Mhash mcrypt
Mkdir-p/soft/package/src
cd/soft/package/src
wget http://ftp.gnu.org/pub/gnu/libiconv/ libiconv-1.14.tar.gz
Tar zxf libiconv-1.14.tar.gz
CD libiconv-1.14
./configure--prefix=/usr/local/ Libiconv
Make
Make install
CD. /
Cd/soft/package/src
Tar XF php-5.3.27.tar.gz
CD 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-ftp
ln-s/soft/mysql/lib/libmysqlclient.so.18/usr/lib64/
Touch Ext/phar/phar.phar
Make && make install
Ln-s/soft/php5.3.27//soft/php
Cp/soft/package/src/php-5.3.27/php.ini-production/soft/php/lib/php.ini
Cp/soft/php/etc/php-fpm.conf.default/soft/php/etc/php-fpm.conf
/soft/php/sbin/php-fpm
PHP5.3 Compilation Parameters detailed
[[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 is/soft/php5.3.27
--with-mysql=/soft/mysql/need to specify the MySQL installation path and install 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 support for FreeType font library
--with-jpeg-dir opening support for JPEG images
--with-png-dir opening support for PNG images
--with-zlib Open the support for Zlib Library for HTTP compression transport
--WITH-LIBXML-DIR=/USR opening support for LIBXML2 libraries
--enable-xml
--disable-rpath to close additional runtime files
--enable-safe-mode Turn on Safe mode
--enable-bcmath Open picture resizing, use this module when monitoring with Zabbix
--enable-shmop
--enable-sysvsem using the SYSV signaling mechanism, this option is turned on
--enable-inline-optimization Optimizing Threads
--with-curl opening the Curl browsing tool support
--with-curlwrappers operation Curl Tool opens URL stream
--enable-mbregex
--enable-mbstring Support Mbstring
--with-mcrypt Encoding Function Library
--WITH-GD opening the GD library support
--enable-gd-native-ttf supports TrueType string function libraries
--with-openssl OpenSSL support for encrypted transmissions
Extension of--with-mhash Mhash algorithm
--enable-pcntl FreeTDS need to use, may be link mssql
--enable-sockets Open Sockets support
--WITH-XMLRPC Open the C language of XML-RPC
--enable-zip opening support for zip
--enable-soap extension of the SOAP module
--enable-short-tags Start and Mark functions
--enable-zend-multibyte Multi-byte support for Zend
--enable-static generating a static link library
--with-xsl opening XSLT file support, extending the LibXML2 library, requires LIBXSLT software
--ENABLE-FTP Support for Open FTP
--ENABLE-FPM means activating 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/
Creating a 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 to version (easy to upgrade and follow-up 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 the 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 the Calendar extension feature
--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 this module when monitoring with Zabbix
--ENABLE-EXIF//Image meta-data support
--ENABLE-FTP//Open FTP support
--enable-mbstring//Support mbstring
--ENABLE-SHMOP//Enable SHMOP support
--enable-sockets//Open Sockets support
--enable-dtrace//Turn on DTrace (dynamic tracking) support
Extension of the--enable-soap//soap module
--enable-zip//Open Zip support
--enable-mbregex//Multibyte string function
--enable-inline-optimization/Optimize threads
--enable-pcntl//freetds need to use, may be link mssql
--ENABLE-PDO//compatible with PHP interface data connection extension.
--ENABLE-GD-NATIVE-TTF//Support TrueType String function library
--enable-opcache//Turn on Opcache cache.
--enable-xml//
--ENABLE-MAINTAINER-ZTS/Enable thread safety-code maintainer use
--ENABLE-FPM//Indicates activating the PHP-FPM mode service, that is, factcgi way to run PHP service
--with-iconv-dir=/usr/local/libiconv//libiconv Library, conversion between various character sets
--with-gettext//Open GNU GetText Support, encoding library used to
--with-libxml-dir//Open support for LIBXML2 Library
--with-zlib//Open Zlib Library support for HTTP compression transport
--WITH-KERBEROS=/USR//OPENSSL includes Kerberos support
--with-openssl//OPENSSL Support, encrypted transmission is used to
Extension of--with-mhash//mhash algorithm
--with-mysql-sock=mysql_socket//Specify the socket for MySQL. If not specified, search by default location
--with-mysqli=mysqlnd//mysqli Extension
--with-pdo-mysql=mysqlnd//pdo:mysql Support. Dir is the basic directory of MySQL, if no value or Mysqlnd is passed 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 directory or Pg_config (Pgsql required)
--with-curl//Turn on the Curl Browse tool support
--WITH-GD//Open GD library support
--with-xpm-dir//Specify the installation directory of the GD library libxpm
--with-jpeg-dir//Turn on support for JPEG images
--with-png-dir//Turn on support for PNG images
--with-freetype-dir//open to FreeType font library support
--WITH-XMLRPC//Open the C language of XML-RPC
--with-fpm-user=nobody//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. Version 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 run-Library files
Make zend_extra_libs= '-liconv-l/usr/local/libiconv/lib '//iconv libraries can perform conversions between various character sets, such as the conversion of utf-8 and gb2312 encodings
Make zend_extra_libs= '-liconv '
Make install
CP Php.ini-production/usr/local/php7/etc/php.ini
Configure it can automatically set the source program to meet the characteristics of UNIX system on different platforms, and generate the appropriate makefile file according to the system number and environment, so that the source can be easily compiled on different platforms.
Make 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 Optional Parameters
--WITH-XSL=SHARED,/USR//Open XSLT file support, extended libXML2 Library, need libxslt software
--WITH-ZLIB-DIR=/USR//define the directory where the zlib is installed (compressed and archived)
--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//Includes recode support (Recode library can convert files between various coded character sets and surface encodings)
--WITH-PSPELL=SHARED,/USR//Includes 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 the LIBVPX (VP8 codec)
--with-system-tzdata//Program execution function
--ENABLE-INTL//Turn on internationalization support (internationalization and character encoding support)
--WITH-MSSQL=SHARED,/USR//contains MSSQL-DB support and specifies FREETDS software catalog (PHP7 removed)
--WITH-LDAP=SHARED,/USR//LDAP Expansion Module
--WITH-LDAP-SASL=/USR//LDAP Expansion Module
--WITH-UNIXODBC=SHARED,/USR//Includes UnixODBC support (local MySQL via ODBC link)
--disable-static//Disabling static libraries
PHP7 Default, 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 resides
--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/share/man//Manual Documentation Directory DIR (Datarootdir under the default installation path under the man directory)
--disable-short-tags default disables the short form of the start tag <?.
--disable-libtool-lock avoid locking (may disrupt parallel builds)
--disable-all Disable all extensions enabled by default
--enable-shared=pkgs//Enable build shared library by default
--enable-static=pkgs//enable build static library by default
--enable-fast-install = pkgs//default enable quick Install after optimization
--enable-ctype//ctype extension, enabled by default from PHP4.2.0. Disabled via--disable-ctype
--with-pear=/usr/share/php//pear (implements such as destructor, error capture function) 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. Pcre function can be disabled by--without-pcre-regex//
--WITH-LAYOUT=GNU//Display the layout of the installation file PHP or GNU (default PHP)
--with-regex=php//Regular expression library type (default type=php)
--with-sqlite3=shared,/usr//5.3 starts the SQLite3 extension by default.
--with-mysql-sock=sockpath//mysql UNIX socket pointer position. If not specified, the default location will be searched
--with-odbcver=hex//Mandatory ODBC version is supported. The expected hexadecimal number, which defaults to 0x0300.
--WITH-GNU-LD//Assuming C compiler uses GNU ld default = no
--with-config-file-path=path//Set the search path for php.ini. The default is Prefix/lib.
--with-fpm-user=//default Nobody user
--with-fpm-group=//default Nobody user group
--with-tsrm-pthreads//The POSIX thread is used by default.
--with-pic//try to use only pic/non-pic objects, by default
--with-apxs[=file]//Compile the shared Apache module. FILE is the path to the optional Apache Apxs tool, which points to apxs by default.
PHP Compilation Installation