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的存储过程, handles MySQL transactions, and can also make access to the database work more stable. Make Zend_extra_libs='-liconv'Make Install
--prefix=/usr/local/PHP Specifies the PHP installation directory--with-apxs2=/usr/local/apache/bin/APXS Integrated APACHE,APXS function is to use the loadmodule instruction in Mod_so, load the specified module to Apache, require Apache to open so module--with-config-file-path=/usr/local/php/etc specify php.ini location--with-mysql=/usr/local/mysqlmysql 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 turns on Safe mode--enable-FTP Open FTP support--enable-zip-open support for zip--with-bz2 opening support for bz2 files--with-jpeg-dir opens support for JPEG images--with-png-dir opens support for PNG images--with-freetype-dir opens support for the FreeType font library--without-Iconv Close Iconv function, conversion between kinds of character sets--with-libxml-dir open support for LIBXML2 library--WITH-XMLRPC Open xml-RPC's C language--with-zlib-dir open support for Zlib library--with-GD Open the support of GD library--enable-gd-native-TTF supports TrueType string function libraries--with-Curl Opens the Curl Browsing tool support--with-Curlwrappers using the Curl tool to open the URL stream--with-ttf Open freetype1.*of 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 to open the Calendars extension feature--enable-mbstring Multi-byte, string support--enable-Bcmath Open picture resizing, use this module for Zabbix monitoring--enable-sockets Open Sockets support--enable-metadata support for EXIF images--enable-magic-quotes support for Magic quotes--disable-Rpath to close additional runtime files--disable-Debug off Debugging Mode--with-mime-magic=/usr/share/file/magic.mime Magic Head File location CGI mode installation Parameters--enable-fpm hits PHP.-the FPM patch only has this parameter, and the CGI-style installation of the startup program--enable-FastCGI support FastCGI way to start PHP--enable-force-cgi-redirect redirect mode to start PHP--with-ncurses supports ncurses screen drawing and dynamic library based on text terminal's interactive function of graphics--enable-pcntl FreeTDS need to use, may be linked to MSSQL to use the Mhash and mcrypt algorithm extension--with-MCrypt Algorithm--with-Mhash algorithm above function library needs to be installed--with-GMP should be supportive of a specification--enable-inline-Optimization Optimizing Threads--with-support for OpenSSL OpenSSL, used in encrypted transmissions--enable-dbase establishes a DBA as a shared module--with-pcre-dir=/usr/local/bin/pcre-Config Perl installation location of the regular library case--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 Specifies theAfter--with-apxs2=/usr/local/apache/bin/apxs, do not activate--ENABLE-FPM and--enable-fastcgi,apxs php is loaded 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 by default Open XML support, the other base library, 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, the TTF library needs the support of FreeType library. --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 requires the OpenSSL library. 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 the product model, like pear, SHMOP, FTP, etc., are not recommended to use, they want to do things, with C/c++, with Java, and even other scripting languages, has a very fast choice, without having to be limited to using PHP. 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, Linux2. 6 under the fcgi, the XCache has good practical experience, and the other is severely attenuated after the number of concurrent increases. 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-Configmakemake Installln-S. /ext/sockets/modules/sockets.so sockets.so to establish a soft connection to the so dynamic link library. Compile 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 Makemake Installwhich PHP ensures that PHP is up-to-date and can be built with soft links.
Linux compile and install PHP options