1.安装php依赖包
yum install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel\ libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel -y
安装libiconv ./configure --prefix=/usr/local/libiconv make make install
2.安装php
./configure --prefix=/usr/local/php-5.5.38 \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-xmlrpc \
--with-openssl \
--with-zlib \
--with-freetype-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-iconv-dir=/usr/local/libiconv \
--enable-sockets \
--enable-mbstring \
--enable-soap \
--enable-static \
--enable-gd-native-ttf \
--with-curl \
--with-xsl \
--enable-ftp \
--with-libxml-dir
编译失败 安装 yum install openssl-devel yum install libxslt-devel
3.make && make install 成功 cp php.ini-development /usr/local/php/lib/php.ini
4.apache httpd.conf 增加2行 第311行
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
5.该首页地址为index.php
转载于:https://www.cnblogs.com/wuhua1/p/linux7.html