PHP Common compilation Parameters Chinese description, _php tutorial

Source: Internet
Author: User

PHP Common compilation parameter Chinese description,


Explanation of common parameters for compiling PHP

Copy CodeThe code is as follows:
--prefix=/usr/local/php #指定 PHP installation directory
--with-apxs2=/usr/local/apache/bin/apxs #整合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 #用来指定 path to Php3.ini or Php4.ini
--with-mysql=/usr/local/mysql #mysql安装目录, support for MySQL
--with-mysqli=/usr/local/mysql/bin/mysql_config #mysqli扩展技术不仅可以调用MySQL的存储过程, handles MySQL transactions, and also makes access to the database more stable.
--with-mysql-sock=/tmp/mysql.sock #指定mysql套接字文件位置
--enable-safe-mode #打开安全模式, the default value is open
--disable-short-tags #配置本选项后, PHP program can not use the short mark, must use the long mark
--with-exec-dir=dir #PHP Execution path (sometimes for system security purposes, specify the directory in which the PHP program must be executed)
--enable-ftp #打开ftp的支持
--enable-zip #打开对zip的支持
--WITH-BZ2 #打开对bz2文件的支持
--with-jpeg-dir #打开对jpeg图片的支持
--with-png-dir #打开对png图片的支持
--with-freetype-dir #打开对freetype字体库的支持
--without-iconv #关闭iconv函数, conversion between various character sets
--with-libxml-dir #打开libxml2库的支持
--with-xmlrpc #打开xml the C language of-RPC
--with-zlib-dir #打开zlib库的支持
--WITH-GD #打开gd库的支持
--enable-gd-native-ttf #支持TrueType字符串函数库
--with-curl #打开curl浏览工具的支持
--with-curlwrappers #运用curl工具打开url流
--with-ttf #打开freetype1. * Support, can not add
--with-xsl #打开XSLT file Support, expanded the LibXML2 library, requires LIBXSLT software
--with-gettext #打开gnu gettext Support, the code library is used to
--with-pear #打开pear命令的支持, PHP extension
--enable-calendar #打开日历扩展功能
--enable-mbstring #多字节, String support
--enable-sqlite-utf8 #使sqllite支持utf-8
--enable-bcmath #打开图片大小调整, this module was used for Zabbix monitoring.
--enable-sockets #打开 sockets support
--enable-exif #图片的元数据支持
--enable-magic-quotes #魔术引用的支持
--disable-rpath #关闭额外的运行库文件
--disable-debug #关闭调试模式
--enable-debug #本选项一般不会使用 unless it is useful to develop PHP programs. It can display additional error messages
--with-ldap=dir #若要使用目录协议 (Lightweight Directory Access Protocol, LDAP) You must open this option. For details about LDAP, refer to the RFC1777 and RFC1778 of the RFC file
--with-mime-magic=/usr/share/file/magic.mime #魔术头文件位置
--with-apache=dir #用本选项可以让 PHP used in Apache module, DIR string can be/usr/local/apache or other directory installed Apache
--with-custom-odbc=dir #使用自订的 ODBC function library. Of course, the custom_odbc_libs and CFLAGS variables are specified when using this method. For example, you might want to configure the system environment variables CFLAGS=-DODBC_QNX, Ldflags=-lunix, and custom_odbc_libs= "-ldblib-lodbc" when using Sybase SQL Anywhere on the QNX machine, and in P HP Configuration Join--WITH-CUSTOM-ODBC=/USR/LIB/SQLANY50
--with-oracle=dir #使用 Oracle Database. Oracle versions are available in version 7.3 and above. You can also use the environment variable Oracle_home in your PHP program to specify the path to ORACLE. For more information on Oracle, please refer to Oracle's website http://www.oracle.com
--with-sybase=dir #使用 Sybase database. For more information on Sybase, please refer to Sybase's website http://www.sybase.com
--with-sybase-ct=dir #使用 SYBASE-CT Database

CGI-style installation of common parameters:

Copy the Code code as follows:
--ENABLE-FPM #打上PHP-fpm Patch only after this parameter, CGI installation of the startup program
--enable-fastcgi #支持fastcgi方式启动PHP
--enable-force-cgi-redirect #重定向方式启动PHP
--with-ncurses #支持ncurses screen drawing and dynamic library of graphical interactive functions based on text terminal
--enable-pcntl #freeTDS需要用到的, maybe it's a link to MSSQL.
--with-mcrypt #mcrypt算法的扩展
--with-mhash #mhash算法的扩展
The above function libraries need to be installed
--with-gmp #应该是支持一种规范
--enable-inline-optimization #优化线程
--with-openssl #openssl的支持, used to encrypt the transmission
--enable-dbase #建立DBA as a shared module
--with-pcre-dir=/usr/local/bin/pcre-config #perl的正则库案安装位置
--disable-dmalloc
--WITH-GDBM #dba的gdbm支持
--enable-sigchild
--enable-sysvsem
--enable-sysvshm
--enable-zend-multibyte #支持zend的多字节
--enable-mbregex
--enable-wddx
--enable-shmop
--enable-soap

Note: Extensions that need to be installed separately

1. GD Library.
2. Expansion of the Ming.
3. Extension of Mhash and MCrypt

1> Specify the--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS, do not activate--ENABLE-FPM and--enable-fastcgi,apxs is PHP module in the mode of loading PHP.

2>mysql after compiling the MySQL development library, you can not specify the MySQL path.

3>php compiles the underlying dependency relationship, compiling PHP first needs to install the XML extension, because the PHP5 core opens XML support by default, and the other base libraries, as appropriate, need:

4>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.

5>--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.

6>-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 performance and stress testing, find out the best combination of process number.

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.




http://www.bkjia.com/PHPjc/885649.html www.bkjia.com true http://www.bkjia.com/PHPjc/885649.html techarticle PHP Common compilation parameters in Chinese description, compile php commonly used parameters interpretation copy code code is as follows:--prefix=/usr/local/php #指定 PHP installation directory--with-apxs2=/usr/local/apache/bi ...

  • 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.