PHP Official: http://www.php.net/downloads.php
Download PHP:
[Email protected] httpd-2.2.16]# CD/USR/LOCAL/SRC
[Email protected] src]# wget http://am1.php.net/distributions/php-5.3.27.tar.gz
Extract:
[Email protected] src]# tar zxf php-5.3.27.tar.gz
To configure the compilation parameters:
[Email protected] src]# CD php-5.3.27
[Email protected] php-5.3.27]#/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-ipv6
In this step, you encounter the following error:
Configure:error:xml2-config not found. Please check your LIBXML2 installation.
The solution is:
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 found
Configure: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.aminglinux.com/bbs/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm"
Yum Install-y libmcrypt-devel
Compile:
[[email protected] php-5.3.27]# make
Installation:
[[email protected] php-5.3.27]# make install
Copy the configuration file:
[email protected] php-5.3.27]# CP Php.ini-production/usr/local/php/etc/php.ini
PHP Compilation Installation