PHP Common Compiler Parameters Chinese description _php Example

Source: Internet
Author: User
Tags fpm gettext odbc openssl openssl library pear sybase sybase database

Interpretation of common parameters for compiling PHP

Copy Code code as follows:

--prefix=/usr/local/php #指定 PHP installation directory
--with-apxs2=/usr/local/apache/bin/apxs #整合apache, the APXS function is to use the loadmodule instruction in Mod_so to load the specified module to Apache, asking Apache to open the so module
--with-config-file-path=/usr/local/php/etc #用来指定 Php3.ini or Php4.ini path
--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 database work 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 tag, must use the long tag
--with-exec-dir=dir #PHP Execution path (sometimes for system security considerations, specify which directory the PHP program must execute)
--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 the various character sets
--with-libxml-dir #打开libxml2库的支持
--with-xmlrpc #打开xml-rpc's C language
--with-zlib-dir #打开zlib库的支持
--WITH-GD #打开gd库的支持
--enable-gd-native-ttf #支持TrueType字符串函数库
--with-curl #打开curl浏览工具的支持
--with-curlwrappers #运用curl工具打开url流
--with-ttf #打开freetype1. * Support, you can not add
--with-xsl #打开XSLT file support, expands LibXML2 library, requires LIBXSLT software
--with-gettext #打开gnu gettext Support, the encoding library is used to
--with-pear #打开pear命令的支持, PHP extension
--enable-calendar #打开日历扩展功能
--enable-mbstring #多字节, support for strings
--enable-sqlite-utf8 #使sqllite支持utf-8
--enable-bcmath #打开图片大小调整, this module was used to monitor the Zabbix.
--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 turn this option on. 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 is used in the Apache module, DIR's string can be/usr/local/apache or other directories to install Apache
--with-custom-odbc=dir #使用自订的 ODBC function library. Of course, you specify the custom_odbc_libs and Cflags variables when using this method. For example, when using Sybase SQL Anywhere on QNX machines, you might configure system environment variables CFLAGS=-DODBC_QNX, Ldflags=-lunix, and custom_odbc_libs= "-ldblib-lodbc" and HP Configuration Join--WITH-CUSTOM-ODBC=/USR/LIB/SQLANY50
--with-oracle=dir #使用 Oracle Database. Oracle versions are to be in version 7.3. You can also use environment variable Oracle_home in your PHP program to specify the path to ORACLE. For more information about 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

The CGI method installs the commonly used parameters:

Copy Code code as follows:

--ENABLE-FPM #打上PHP-fpm Patch only after this parameter, CGI installation of the boot program
--enable-fastcgi #支持fastcgi方式启动PHP
--enable-force-cgi-redirect #重定向方式启动PHP
--with-ncurses #支持ncurses screen drawing and dynamic library of graphic interactive function based on text terminal
--enable-pcntl #freeTDS需要用到的, may be linked to MSSQL to use
--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. The expansion of the Ming.
3. Expansion of Mhash and MCrypt

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

2>mysql after compiling the MySQL development library, you do not have to specify the MySQL path.

3>php compile the underlying dependency relationship, compiling PHP first requires the installation of XML extensions, since the PHP5 core defaults to open XML support, and other base libraries, corresponding to:

4>GD-> zlib, Png, JPG, if you need to support other, you still need to compile the expansion library according to the actual situation, TTF library needs FreeType library support.

5>--enable-magic-quotes, is an extremely not recommended parameter, of course, if you need PHP for you to do these under the work, in fact he did not very thoroughly solve the problem.

6>-with-openssl, you need OpenSSL library.

Mysqli is the MySQL driver provided by the MySQL team, with many practical features and typical features. But he's not the best choice for MySQL on the PHP platform, PDO proved to be a simple, high concurrency, and easy to create and recycle standard interface. However, PDO also experienced a memory overflow problem prior to 5.3, after 5.3, when reading Oracle's LOB resources, if memory is not restricted, there will still be memory overflow.

If it is a product model, like pear, SHMOP, FTP, etc., are not recommended, they want to do things, with C + +, with Java, and even other scripting language, there are very good fast choice, without the need to limit the use of PHP to achieve. Unfamiliar class libraries and infrequently used libraries are not recommended. Magic-quote, Session.auto_start, PHP server information, PHP error information, etc. after the compilation is completed, should be closed the first time, to avoid exposing server information.

PHP corresponding to the Web server mode, Module, fastcgi, FPM only need one, the server is not your experimental plots. FastCGI can choose Nginx and lighttpd, in fact Nginx is also LIGHTTPD process management using SPWAN-FCGI. FPM is using PHP itself to manage multiple processes, somewhat like a back-end agent. No matter what mode, in the release of the product server, should do process and thread tuning, do enough performance and stress testing to find the best combination of process number.

Choose a php OPCode cache extension, this is also very important, under the Linux 2.6 core, fcgi, XCache has a good experience, the other in the increase in the number of concurrent, the performance attenuation is serious. If you really want to experience, you would rather compile a few PHP versions, and not for a version of PHP collection of various extensions, adapt to various environments, which will put yourself into a dilemma.

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.