PHP Compilation Options
PHP Installation
./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-mysql=/usr/local/mysql-- With-mysqli=/usr/bin/mysql_config--with-iconv-dir=/usr/local--with-freetype-dir--with-jpeg-dir--with-png-dir-- With-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-discard-path--enable-safe-mode-- Enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl--with-curlwrappers-- Enable-mbregex--enable-fastcgi--enable-fpm--enable-force-cgi-redirect--enable-mbstring--with-mcrypt--WITH-GD-- Enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets--with-ldap--WITH-LDAP-SASL-- With-xmlrpc--enable-zip--enable-soap--without-pear--with-zlib--enable-pdo--with-pdo-mysql--with-mysql
#mysqli扩展技术不仅可以调用MySQL的存储过程, handle MySQL transactions, and also make access to the database more stable.
Make zend_extra_libs= '-liconv '
Make install
--prefix=/usr/local/php
Specify the PHP installation directory
--with-apxs2=/usr/local/apache/bin/apxs
The integrated APACHE,APXS function is to use the LoadModule directive in MOD_SO to load the specified module to Apache, which requires Apache to open the so module
--with-config-file-path=/usr/local/php/etc
Specify PHP.ini location
--with-mysql=/usr/local/mysql
MySQL installation directory, support for MySQL
--with-mysqli=/usr/local/mysql/bin/mysql_config
MYSQLI extension technology can not only invoke MySQL's stored procedures, handle MySQL transactions, but also make access to the database work more stable.
--enable-safe-mode Turn on Safe mode
--ENABLE-FTP Support for Open FTP
--enable-zip opening support for zip
--WITH-BZ2 opening support for bz2 files
--with-jpeg-dir opening support for JPEG images
--with-png-dir opening support for PNG images
--with-freetype-dir opening support for the FreeType font library
--without-iconv Close Iconv function, conversion between kinds of character sets
--with-libxml-dir opening support for LIBXML2 libraries
--WITH-XMLRPC Open the C language of XML-RPC
--with-zlib-dir opening support for zlib libraries
--WITH-GD opening the GD library support
--enable-gd-native-ttf supports TrueType string function libraries
--with-curl opening the Curl browsing tool support
--with-curlwrappers using the Curl tool to open the URL stream
--with-ttf Open freetype1.* Support, can not add
--with-xsl opens XSLT file support, expands the LibXML2 library, requires LIBXSLT software
--with-gettext opens the GNU gettext Support, the code library uses the
--with-pear Open the support for Pear command, PHP extension with
--enable-calendar opening the Calendar extension feature
--enable-mbstring Multi-byte, string support
--enable-bcmath Open picture resizing, use this module for Zabbix monitoring
--enable-sockets Open Sockets support
Meta-data support for--ENABLE-EXIF images
--enable-magic-quotes Support for Magic quotes
--disable-rpath to close additional runtime files
--disable-debug turning off debug mode
--with-mime-magic=/usr/share/file/magic.mime Magic Head File location
Parameters for CGI mode installation
--enable-fpm
After the PHP-FPM patch has this parameter, CGI installation of the startup program
--enable-fastcgi
Support FastCGI way to start PHP
--enable-force-cgi-redirect
redirect Start PHP
--with-ncurses
Dynamic library that supports ncurses screen drawing and graphical interactive functions based on text terminal
--enable-pcntl FreeTDS need to use, may be linked to MSSQL to use
Extension of the Mhash and MCrypt algorithms
--with-mcrypt algorithm
--with-mhash algorithm
The above function libraries need to be installed
--WITH-GMP should be supportive of a specification
--enable-inline-optimization Optimizing Threads
--with-openssl OpenSSL support for encrypted transmissions
--enable-dbase establishing a DBA as a shared module
--with-pcre-dir=/usr/local/bin/pcre-config Perl's regular library installation location
--disable-dmalloc
--WITH-GDBM DBA's GDBM support
--enable-sigchild
--enable-sysvsem
--enable-sysvshm
--enable-zend-multibyte Multi-byte support for Zend
--enable-mbregex
--enable-wddx
--enable-shmop
--enable-soap
After specifying the--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS, do not activate--ENABLE-FPM and--ENABLE-FASTCGI,APXS are loaded PHP in PHP module mode.
MySQL after compiling the MySQL development library, you can not specify the path of MySQL.
PHP compiler has a basic dependency relationship, compiling PHP first needs to install the XML extension, because the PHP5 core opens XML support by default, the other base libraries, the corresponding need:
GD--Zlib, Png, JPG, if you need to support other, still need to compile the extension library according to the actual situation, TTF library needs FreeType library support.
--enable-magic-quotes, is an extremely deprecated parameter, of course, if you need PHP to do the work for you underneath, in fact he does not solve the problem very thoroughly.
--with-openssl, the OpenSSL library is required.
Mysqli is a MySQL driver provided by the MySQL team, with many useful features and typical features. But he's not the best choice for MySQL on the PHP platform, PDO is proven to be a simple, high concurrency, and easy to create and recycle standard interface. However, PDO also experienced a 5.3 memory overflow problem, and after 5.3, when reading Oracle's LOB resources, the memory is not throttled, but it will still overflow.
If it is a product model, like pear, SHMOP, FTP, etc., are not recommended to use, they want to do things, in C/s, with Java, and even other scripting language, there is a very good and fast choice, not limited to the use of PHP to achieve. Unfamiliar class libraries and infrequently used libraries are also deprecated. Magic-quote, Session.auto_start, PHP server information, PHP error information, etc. after the compilation is completed, the first time should be closed, to avoid exposing the server information.
PHP corresponds to the Web server mode, Module, fastcgi, FPM only need one, the server is not your experimental plot. FastCGI can choose Nginx and lighttpd, in fact, Nginx is also using lighttpd spwan-fcgi for fcgi process management. FPM is the use of PHP itself to manage multiple processes, a bit like a back-end agent. No matter what the mode, in the release of the product server, should do the process and thread tuning, do enough stress testing, find out the best combination of processes.
Choose a php OPCode cache extension, this is also very important, under the Linux 2.6 core, under the fcgi, XCache has good practical experience, the other after the increase in concurrency, the performance attenuation is serious.
If you really want to experience, would rather compile more than a few PHP version, also do not for a version of PHP set up a variety of extensions, adapt to a variety of environments, this will make yourself into a dilemma.
To compile the extension library:
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config
Make
Make install
Ln-s. /ext/sockets/modules/sockets.so sockets.so to establish a soft connection to the so dynamic link library.
Compiling PHP:
./configure--prefix=/usr/local/php--with-curl=/usr/local/curl--enable-mbstring--enable-shmop--enable-sysvsem-- Enable-sysvshm--enable-sysvmsg--with-mysql=/usr/local/mysql--with-mysqli=/usr/bin/mysql_config--enable-sockets
Make
Make install
Which PHP ensures that PHP is up-to-date and can create soft links.
PHP compilation options