您的位置:首页 > 运维架构 > Linux

LAMP环境搭建过程中出现的问题——基于VM虚拟CentOS-5.6

2011-10-22 00:08 831 查看
出现问题并给出解决方法:

1. 出错一:configure libpng时出错:

checking for zlibVersion in -lz... no
configure: error: zlib not installed

提示没有安装zlib,但其实我在安装libpng之前安装就是zlib。
网上说有一种解决办法是回到zlib目录执行make clean后重新配置安装,但失败。
还有一种是,回到zlib目录执行make clean命令,然后依次执行./configure、make、make 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
二、如果你的系统是Ubuntu或Debian:
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了.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  职场 休闲 centos