阿尔哦覅和 发表于 2015-8-20 12:49:43

关于在linux中配置lamp环境的一些问题

  在配置一些安装包时候经常出现安装不了的情况,一般都是缺少了一些编译工具。比如gcc、gcc-c++等工具一定要事前yum -y installgcc gcc-c++吧他们安装上去。
  下面的一些问题:
  1.安装gd库出现错误:
  error: possibly undefined macro: AM_ICONVmake install
cd . && /bin/sh /tmp/jpeg-6b/gd-2.0.35/config/missing --run aclocal-1.9 -I config
aclocal:configure.ac:64: warning: macro `AM_ICONV' not found in library
cd . && /bin/sh /tmp/jpeg-6b/gd-2.0.35/config/missing --run automake-1.9 --foreign
cd . && /bin/sh /tmp/jpeg-6b/gd-2.0.35/config/missing --run autoconf
configure.ac:64: error: possibly undefined macro: AM_ICONV
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
make: *** 错误 1
  造成这个错误,是因为没有gettext,在线安装yum -y install gettext gettext-devel,即可也可以下载一个gettext-0.18.tar.gz安装上去。
  
  2.安装完httpd之后,启动httpd服务器报错
  httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
  这个问题就是SELinux保护模式引起的,把它关闭即可。
  编辑/etc/selinux/config,找到这段: # This file controls the state of SELinux on the system.
  # SELINUX= can take one of these three values:
  # enforcing - SELinux security policy is enforced.
  # permissive - SELinux prints warnings instead of enforcing.
  # disabled - SELinux is fully disabled.
  SELINUX=enforcing
  把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为: SELINUX=disabled 保存,关闭。
  编辑/etc/sysconfig/selinux,找到: # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=enforcing
  如果SELINUX已经是 SELINUX=disabled,那么就不用改了,否则就把SELINUX=enforcing 注释掉,新加一行: SELINUX=disabled 保存,退出。
  如果你碰到其他类似提示: cannot restore segment prot after reloc: Permission denied 哪应该是SELinux的问题,可以考虑把它关闭。
  最后重启linux即可啦。
  
  3.安装mysql报错
  checking for tgetent in -ltermcap… no
checking for termcap functions library… configure: error: No curses/termcap library found
  有分析可以知道,缺少了curses/termcap 库没有安装,所以去下载一个ncurses-5.6.tar.gz
安装之,再安装yum -y install ncurses-devel即可啦。
  
  小结:在我们安装一些软件或环境时,当有报错的情况,首先要查看一下报错的原因,是不是缺少一些编译的工具,
  如果是缺少了所需的编译工具的话,那么我们就要把编译工具先安装上去。。如果看不懂,或不是编译工具引起的,
  那么我们就应该把错误复制过来找度娘或谷歌。【最好要经常写笔记】
  
  
  
  
页: [1]
查看完整版本: 关于在linux中配置lamp环境的一些问题