Whether it is to install PHP or later to add extensions to PHP, in fact, directly download the PHP source package, the inside of the install file read it will be.
1, install PHP
installation, not to consider so much, after a variety of dependent packages installed, directly follow the method installed in the installation of a simple PHP, and then use a shared way to add additional PHP extension package to ok!
2,extension Installation
The installation of PHP extensions, the installation of official documentation is available in two ways: pecl Way and Phpize Way
Then there are two ways to join the extension: Shared and static (probably all in a shared way ...). )
I'm using phpize to add it in a shared way
Under the PHPSRC directory, switch to: Ext/extname directory, execute the following command:
The command is simple:
$ CD Extname
$ phpize or phpize--clean (this is the first time the installation failed, one step before the second installation to clean up the action)
$./configure
$ make
# make Install
Some errors may be prompted at this time, and errors are generally caused by the lack of some libraries, and the following are some common errors:
Error: Configure:error:Please Reinstall the Libcurl distribution-easy.h should be in <Curl-dir&G t; /include/curl/
Solution: Yum-y Install Curl-devel
Error: If Configure fails try --with-jpeg-dir= Configure: Error:libpng. (A|SO) not found.
Solution: Yum-y Install Libpng-devel
Error: Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.
Solution: Yum Install Libmcrypt Libmcrypt-devel
Error: Configure:error:xml2-config not found. Please check your LIBXML2 installation.
Solution: Yum-y Install LIBXML2 Libxml2-devel
Error: Configure:error:libevent >= 1.4.11 could not be found
Solution: Yum-y Install libevent Libevent-devel
Linux sharing method compiled PHP extension