Linux compilation installation PHP parameter description

Source: Internet
Author: User
Tags deprecated gettext openssl library pear php server php compiler php error zend

    • Detailed configuration of PHP parameters
--prefix=/usr/local/phpSpecify the PHP installation directory--With-apxs2=/usr/local/apache/bin/apxsIntegrate Apache,The APXS function is to use the LoadModule directive in the Mod_so,Loading the specified module to Apache requires Apache to open the so module--With-config-file-path=/usr/local/php/etcSpecify php.ini Location--With-mysql=/usr/local/mysqlMySQL installation directory, support for MySQL--With-mysqli=/usr/local/mysql/bin/mysql_configMYSQLI extension technology can not only call the MySQL stored procedure, processing MySQL transaction,It also makes access to the database more stable. --enable-safe-modeTurn on Safe Mode--enable-ftpOpen the support for FTP--enable-zipOpen support for zip--with-bz2Open support for bz2 files--With-jpeg-dirTurn on support for JPEG images--With-png-dirOpen support for PNG images--With-freetype-dirOpen support for the FreeType font library--without-iconvClose the Iconv function, conversion between the various character sets--With-libxml-dirOpen support for LIBXML2 libraries--With-xmlrpcOpen the C language of XML-RPC--With-zlib-dirOpen support for zlib libraries--With-gdOpen the GD library support--enable-gd-native-ttfSupports TrueType string function libraries--With-curlTurn on the Curl Browsing tool support--With-curlwrappersUse the Curl tool to open the URL stream--With-ttfOpen freetype1.* Support, can not add--With-xsl//open XSLT file support, expanded LibXML2 library, need libxslt software--with-gettext //open GNU gettext Support, encoding library for--with-pear / /Open support for pear command, PHP extension with--enable-calendar //open Calendar extension--enable-mbstring //multibyte, string support--enable-bcmath //open picture resizing, Use this module when using Zabbix monitoring--enable-sockets //Open sockets support--enable-exif //image metadata support--enable-magic-quotes //Magic citation support--disable-rpath Span class= "Hljs-comment" >//close additional runtime files--disable-debug //off debug Mode-- with-mime-magic=/usr/share/file/magic.mime //Magic header File location             
    • Parameters for CGI mode installation:
--enable-fpmAfter the PHP-FPM patch has this parameter, CGI installation of the startup program--enable-fastcgiSupport fastcgi mode start Php--enable-force-cgi-redirectREDIRECT Mode start php--With-ncursesDynamic library that supports ncurses screen drawing and graphical interactive function based on text terminal--enable-pcntlFreeTDS need to use, may be linked to MSSQL to use--with-mcrypt //mcrypt algorithm extension-- With-mhash //mhash algorithm extension //above function libraries need to be installed-- with-gmp //should be supported by a specification--enable-inline-optimization //optimization thread--with-openssl //openssl support, --enable-dbase //to establish DBA as shared module--/usr/local/bin/pcre-config //perl of the regular library installation location--disable-dmalloc--< Span class= "Hljs-keyword" >with-gdbm // DBA's gdbm support--enable-sigchild--enable-sysvsem--enable-sysvshm--enable-zend-multibyte // Supports Zend multibyte--enable-mbregex--enable-wddx--enable-shmop--enable-soap         
    • Precautions
  • 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 on the relationship, compiled PHP first need to install XML extensions, 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 requires support for the 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, 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.




Go---Link: https://www.jianshu.com/p/0a79847c8151

Linux compilation installation PHP parameter description

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.