PHP compilation option details

Source: Internet
Author: User
Tags openssl library perl regular expression

PHP compilation option details

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 -- -ldap-sasl -- with-xmlrpc -- enable-zip -- enable-soap -- without-pear -- with-zlib -- enable-pdo -- with-pdo-mysql -- with-mysql
# Mysqli extension technology can not only call MySQL stored procedures, process MySQL transactions, but also make database access 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

Integrate apache. apxs uses the LoadModule command in mod_so to load a specified module to apache. apache is required to open the SO module.

-- With-config-file-path =/usr/local/php/etc

Specify the php. ini location

-- With-MySQL =/usr/local/mysql

Mysql installation directory, which supports mysql

-- With-mysqli =/usr/local/mysql/bin/mysql_config

Mysqli extension technology can not only call the MySQL stored procedure and process MySQL transactions, but also make database access more stable.

-- Enable-safe-mode: enable safe mode.

-- Enable-ftp support for enabling ftp

-- Enable-zip supports zip

-- With-bz2 opens support for bz2 files

-- With-jpeg-dir open support for jpeg images

-- With-png-dir open support for png Images

-- With-freetype-dir: Support for freetype Library

-- Without-iconv disable the iconv function to convert character sets.

-- With-libXML-dir: supports opening the libxml2 library

-- With-XMLrpc open the C language of xml-rpc

-- With-zlib-dir supports opening the zlib library

-- With-gd supports opening the gd library

-- Enable-gd-native-ttf supports TrueType string function library

-- With-curl support for enabling the curl browser Tool

-- With-curlwrappers use curl to open a url stream

-- With-ttf enables freetype1. *.

-- With-xsl: supports opening XSLT files, extends the libXML2 library, and requires libxslt software.

-- With-gettext: Open the gnu gettext support, which is used by the encoding library.

-- With-pear support for opening the pear command, which is used for PHP Extension

-- Enable-calendar to enable the calendar Extension function

-- Enable-mbstring multi-byte, string supported

-- Enable-bcmath: enable image size adjustment. This module is used for zabbix monitoring.

-- Enable-sockets support enabling sockets

-- Enable-exif metadata support for images

-- Enable-magic-quotes magic reference support

-- Disable-rpath

-- Disable-debug disable debugging mode

-- With-mime-magic =/usr/share/file/magic. mime magic header file location

Parameters used for CGI Installation

-- Enable-fpm

This parameter is available only after the PHP-fpm patch is installed. The startup program installed in CGI Mode

-- Enable-fastCGI

Supports fastcgi to start PHP

-- Enable-force-CGI-redirect

Redirect to start PHP

-- With-ncurses

Dynamic library supporting ncurses screen rendering and graphic interaction based on text Terminals

-- Enable-pcntl freeTDS is required. It may be used only when mssql is linked.

Extensions of mhash and mcrypt Algorithms

-- With-mcrypt Algorithm

-- With-mhash Algorithm

The above function library needs to be installed

-- With-gmp should support a Specification

-- Enable-inline-optimization thread

-- With-openssl support, used for encrypted transmission

-- Enable-dbase: Create a DBA as a shared Module

-- With-pcre-dir =/usr/local/bin/pcre-config installation location of the perl Regular Expression Library

-- Disable-dmalloc

-- With-gdbm dba gdbm support

-- Enable-sigchild

-- Enable-sysvsem

-- Enable-sysvshm

-- Enable-zend-multibyte supports multiple zend bytes.

-- Enable-mbregex

-- Enable-wddx

-- Enable-shmop

-- Enable-soap

After -- with-apxs2 =/usr/local/apache/bin/apxs is specified, do not activate -- enable-fpm and -- enable-fastCGI, apxs loads php in the PHP module mode.

After Mysql compiles the Mysql development library, you do not need to specify the mysql path.

PHP compilation has a basic dependency relationship. To compile PHP, you must first install XML extensions, because the php5 core enables XML support by default. For other basic libraries, you must:

GD-> zlib, Png, and Jpg. If you need to support others, you still need to compile the extension library based on the actual situation. The ttf Library requires freetype library support.

-- Enable-magic-quotes is an extremely unrecommended parameter. Of course, if you need PHP to do the underlying work for you, it does not solve the problem thoroughly.

-- With-openssl: The openssl library is required.

Mysqli is a MySQL driver provided by the MySQL team. It has many practical functions and typical features. However, he is not the best choice for MySQL on the PHP platform. PDO has been proven to be a simple, highly concurrent standard interface that is easy to create and recycle. However, PDO also experienced memory overflow problems before 5.3. After 5.3, when reading Oracle LOB resources, if the memory is not limited, the memory will still overflow.

It is not recommended for product models such as pear, shmop, and ftp. What they want to do is use C/C ++, Java, or other scripting languages, there are good and fast options, and there is no need to limit to using PHP for implementation. Unfamiliar class libraries and infrequently used libraries are not recommended. Magic-quote, session. auto_start, PHP server information, and PHP error information should be closed immediately after compilation to avoid exposing server information.

For the Web Server mode corresponding to PHP, Module, fastcgi, and fpm only need one type. The Server is not your test field. Fastcgi can select Nginx and lighttpd. In fact, Nginx uses lighttpd's spwan-fcgi for fcgi process management. Fpm uses PHP to manage multiple processes, which is similar to a backend proxy. Regardless of the mode, process and thread optimization should be performed on the production server, and sufficient stress tests should be performed to find the best combination of process numbers.

It is also important to choose a PHP OPCode cache extension. At the core of linux 2.6 and fcgi, xcache has good practical experience. When the number of concurrent threads increases, severe performance attenuation.

If you really want to try it out, you 'd rather compile several more PHP versions than compile various extensions for one version of PHP to adapt to various environments, which will put yourself in a dilemma.

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 establishes 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

Make

Make install

Which php ensures that php is the latest and soft links can be established.

PHP 7, you deserve it

Experience PHP 7.0 on CentOS 7.x/Fedora 21

Install LNMP in CentOS 6.3 (PHP 5.4, MyySQL5.6)

Nginx startup failure occurs during LNMP deployment.

Ubuntu install Nginx php5-fpm MySQL (LNMP environment setup)

Detailed php hd scanning PDF + CD source code + full set of teaching videos

Configure the php lnmp development environment in CentOS 6

PHP details: click here
PHP: click here

This article permanently updates the link address:

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.