出现问题并给出解决方法:
 
1. 出错一: configure libpng时出错:
 
checking for zlibVersion in -lz... no
configure: error: zlib not installed
 
 提示没有安装 zlib,但其实我在安装 libpng之前安装就是 zlib
 网上说有一种解决办法是回到 zlib目录执行 make clean后重新配置安装,但失败。
 还有一种是,回到 zlib目录执行 make clean命令,然后依次执行 ./configuremakemake install,其中 configure时不要设置 --prefix的值。然后回来配置 libpng,成功(没有删除前一次在配置 zlib时创建的目录 /usr/local/zlib,不知道以后会不会产生影响)。解决。
 
2. 出错二:安装 apache 出错
 httpd: Syntax error on line 54 of /etc/httpd/httpd.conf: Cannot load /usr/local/apache2/modules/mod_deflate.so into server: /usr/local/apache2/modules/mod_deflate.so: cannot restore segment prot after reloc: Permission denied
解决:修改 /etc/sysconfig/selinux
SELINUX=enforcing改成 SELINUX=disabled
然后执行 setenforce 0
然后再 /usr/local/apache2/bin/apachectl start
3. 出错三:安装 mysql,在./configure时出现错误:error: No curses/termcap library found的解决办法
在网上找到相关资料,确认是 ./configure出了问题,于是回头查看,果然发现问题:最后几行出了错。完整错误信息如下:
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... no
checking for termcap functions library... configure: error: No curses/termcap library found
原因:缺少 ncurses安装包
解决办法:
下载安装相应软件包
一、如果你的系统是 RedHat系列:
yum list|grep ncurses
yum -y install ncurses-devel
yum install ncurses-devel
二、如果你的系统是 UbuntuDebian
apt-cache search ncurses
apt-get install libncurses5-dev
待安装 completed!之后,再 ./configure,顺利通过,然后 make && make install,成功安装,一切 OK~~~
4. 出错四:configure: error: libpng.(a|so) not found.
解决: yum -y install libpng-devel
1.   出错五:
我将 PHP配置好后 ,centos 5下我用浏览器打开 index,php出现了以下 :Warning: Unknown(/usr/local/apache2/htdocs/fbc/index1.php): failed to open stream: Permission denied in Unknown on line 0    
    index.php的代码是 :  <?  phpinfo();  ?>   
   出错原因是 :我是在 window下写的 index.php,FTP传到虚拟机下 ,导致了 index.php权限不够 .因此用 chmod 777 index.php 命令来修改 index.php权限就 OK.