PHP, a nested abbreviated name, is an abbreviation for the English Super Text preprocessing language (Php:hypertext preprocessor). PHP is an HTML embedded language, PHP and Microsoft's ASP quite a bit similar, is a server-side implementation of embedded HTML document scripting language, language style has similar to C language, is now widely used by many web site programmers.
This time let's complete the compilation and installation of PHP, and let Apache support PHP.
First we use the Yum warehouse to install some associated programs:
Yum install \
Libjpeg-devel \
Libpng-devel \
Freetype-devel \
Zlib-devel \
Gettext-devel \
Libxpm-devel \
Libxml2-devel \
Fontconfig-devel \
Openssl-devel \
Bzip2-devel
- Install the GD library to process and generate images:
tar xzvf /opt/lamp/gd-2.0.35.tar.gz -C /opt //解压软件包cd /opt/gd/2.0.35 //移动到目录中./configure --prefix=/usr/local/gd //配置make && make install //编译安装
- Install PHP, enter the configuration text into the PHP directory, and compile the installation:
Tar xjvf/opt/lamp/php-5.4.5.tar.bz2-c/opt//Unpacking Package
CD/OPT/PHP-5.4.5///Move to PHP directory
#输入配置文本:
./configure \
--prefix=/usr/local/php \
--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS \
--WITH-GD \
--with-mysql=/usr/local/mysql \
--WITH-CONFIG-FILE-PATH=/ETC \
--enable-sqlite-utf8 \
--with-zlib-dir \
--with-libxml-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--WITH-TTF \
--with-iconv \
--WITH-OPENSSL \
--with-gettext \
--enable-mbstring \
--ENABLE-GD-NATIVE-TTF \
--enable-gd-jis-conv \
--enable-static \
--enable-zend-multibyte \
--enable-inline-optimization \
--enable-sockets \
--ENABLE-SOAP \
--ENABLE-FTP \
--disable-ipv6
#编译安装:
Make && make install
Resolve errors during make--ignore----
vi /usr/local/gd/include/gd_io.hvoid (*gd_free) (struct gdIOCtx *);void (*data); //添加//}gdIOCtx;cp php.ini-production /etc/php.ini //优化调整PHP//
Build Lamp architecture-3, manually compile and install PHP