1. Download the source package
wget URL/php-5.4.45.tar
2. Unzip the source package
TAR-ZXVF Php-5.4.45.tar
3. Create an installation directory
mkdir/usr/local/php
4, enter the extracted directory, initialize the installation environment:
./configure \
--prefix=/usr/local/php \
--WITH-APXS2=/USR/LOCAL/APACHE/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
Error
Configure:error:jpeglib.h not found.
[Email protected] php-5.4.45]#
Install Yum install-y libjpeg-devel
Error
Configure:error:mcrypt.h not found. Please
Reinstall Libmcrypt.
[Email protected] php-5.4.45]#
Install yum install-y epel-release libmcrypt-devel
5, compilation Yi: Make
6. Installation: Make install
/usr/local/php/bin/php-i viewing the relevant configuration
php5.4 Compiling and installing Apache