标签:localhost 首页 color blog ssl ati with install ESS
构建PHP运行环境[root@localhost lamp]# yum install > libjpeg-devel > libpng-devel > freetype-devel > zlib-devel > gettext-devel > libXpm-devel > libxml2-devel > fontconfig-devel > openssl-devel > bzip2-devel -y
[root@localhost lamp] tar zxvf /opt/lamp/gd-2.0.35.tar.gz -C /opt/
[root@localhost lamp] cd ../gd/2.0.35/
[root@localhost 2.0.35] ./configure --prefix=/usr/local/gd
[root@localhost 2.0.35] make && make install
[root@localhost php-5.5.38] tar zxvf /opt/lamp/php-5.5.38.tar.gz -C /opt/
[root@localhost php-5.5.38] ./configure > --prefix=/usr/local/php > --with-apxs2=/usr/local/httpd/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
[root@localhost php-5.5.38] make && make install
#找到 AddType application/x-gzip .gz .tgz 在下面添加如下内容
[root@localhost ~] vim /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
# 搜索php5有没有下面这个配置
LoadModule php5_module modules/libphp5.so
# 找到这个标签在index.html后面加入index.php
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
[root@localhost ~] systemctl restart httpd.service
[root@localhost ~] cd /usr/local/httpd/htdocs/
[root@localhost htdocs] ls
index.html
[root@localhost htdocs] vim index.html
<h1>accp</h1> #删除原有编辑的首页如果没有就不用
#加入下面的php测试页面
<?php
phpinfo();
?>
[root@localhost htdocs] mv index.html index.php #修改原有html结尾的首页名称改为php结尾
[root@localhost htdocs] ls
index.php
如过不能访问查看一下防火墙有没有关
标签:localhost 首页 color blog ssl ati with install ESS
原文地址:http://blog.51cto.com/13645280/2136415