1. Download wget http://cn2.php.net/distributions/php-5.4.36.tar.bz2
2. Tar jxvf php-5.4.36.tar.bz2
3. CD php-5.4.36
4../configure \
--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--with-config-file-path=/usr/local/php/etc-- With-mysql=/usr/local/mysql--with-libxml-dir--with-gd--with-jpeg-dir--with-png-dir--with-freetype-dir-- With-iconv-dir--with-zlib-dir--with-bz2--with-openssl--with-mcrypt--enable-soap--enable-gd-native-ttf-- Enable-mbstring--enable-sockets--enable-exif--disable-ipv65. Encountered the following error:
Configure:error:xml2-config not found. Please check your LIBXML2 installation.
Workaround: Yum install-y libxml2-devel
There are also errors:
Configure:error:Cannot find OpenSSL ' s <evp.h>
The solution is:
Yum Install-y OpenSSL Openssl-devel
Error:
Checking for BZIP2 in default path ... not foundconfigure:error:Please reinstall the BZIP2 distribution
Workaround:
Yum install-y bzip2 Bzip2-devel
Error:
Configure:error:png.h not found.
Workaround:
Yum install-y libpng Libpng-devel
Error:
Configure:error:freetype.h not found.
Workaround:
Yum install-y FreeType Freetype-devel
Error:
Configure:error:mcrypt.h not found. Please reinstall Libmcrypt.
Workaround:
Rpm-ivh "http://www.lishiming.net/data/attachment/forum/epel-release-6-8_64.noarch.rpm" Yum install-y Libmcrypt-devel
Error: Configure:error:jpeglib.h not found.
Workaround: Yum install-y freetype Freetype-devel
/usr/local/php/bin/php-i can view the configuration
PHP Compilation Installation