在centos6.5-min安装php

1. 确认已安装好 apache. 参阅文章: http://liuyijie2007.iteye.com/blog/2145524

2   确认已成功安装libxml2和libxml2-devel. 若未安装,可到http://rpmfind.net/linux/rpm2html/search.php?query=libxml2 下载和安装

3.  下载 freetype 源码 并安装 在 /usr/local/freetype 目录下

4 . 下载php-5.6.2源码  执行 ./configure --prefix=/usr/local/php --with-freetype-dir=/usr/local/freetype --with-apxs2=/usr/local/apache/bin/apxs  

5    make && make install 后

6    检查 /usr/local/apache/modules/   存在 libphp5.so 文件    /usr/local/apache/conf/httpd.conf 增加了一行

      LoadModule php5_module        modules/libphp5.so

7 找到

<IfModule dir_module> 
  DirectoryIndex index.html 
</IfModule> 

  增加 index.php 如下

<IfModule dir_module> 
  DirectoryIndex index.html index.php 
</IfModule> 

8  找到 <IfModule mime_module></IfModule> 添加

          AddType application/x-httpd-php .php  (注意 .php前面有空格)

9  在 /usr/local/apache/htdocs/test.php  编辑  增加 <? PHPinfo()?>

10 重启apache 输入 http://ip:port/test.php  就会得到如下图

猜你喜欢

转载自liuyijie2007.iteye.com/blog/2145677
今日推荐