LAMP安装问题集

回复 收藏
本帖最后由 biankm_gz 于 2016-3-10 13:45 编辑

一、MySQL常见错误信息的解决方法
1.首次登录时,使用mysql -uroot 报以错误
-bash: mysql: command not found
解决方法:
vi /etc/profile
设置全局变量,在最后一行添加以下内容:
export PATH=$PATH:/usr/local/mysql/bin
source /etc/profile

2.MySQL 5.5编译时出现以下错误
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
or
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
解决方法:
第一步:yum install gcc-c++ -y
第二步:rm  -f CMakeCache.txt
第三步:重新cmake

6.MySQL 5.6编译时出现以下错误
-- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:82 (MESSAGE):
  Curses library not found.  Please install appropriate package,
      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
  cmake/readline.cmake:126 (FIND_CURSES)
  cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)
  CMakeLists.txt:250 (MYSQL_CHECK_READLINE)
解决方法:
rm CMakeCache.txt
yum install ncurses-devel bison

7.
Starting MySQL.. ERROR! The server quit without updating PID file (/data/mysql/CentOS202.pid)
[ERROR] Can't start server : Bind on unix socket: Permission denied
[ERROR] Do you already have another mysqld server running on socket: /usr/local/mysql/mysql.sock ?
[ERROR] Aborting
解决方法:
vi /etc/my.cnf
修改成以结果
[mysqld]
datadir=/data/mysql
socket=/data/mysql/mysql.sock   #/usr/local/mysql/mysql.sock文件路径不对
user=mysql

8.设置mysql 忽略大小写
vi /etc/my.cnf
在最后一行添加
lower_case_table_names = 1

9.密码修改后,使用密码登录报:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)(方法未试)
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root' and host='root' or host='localhost';//把空的用户密码都修改成非空的密码就行了。
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysqld restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>

10.Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
yum install -y libaio libaio-devel


二、PHP常见错误信息的解决方法
在CentOS编译PHP5的时候有时会遇到以下的一些错误信息,基本上都可以通过yum安装相应的库来解决。以下是具体的一些解决办法:

1.checking for BZip2 support… yes checking for BZip2 in default path… not found configure: error: Please reinstall the BZip2 distribution
Fix: yum install bzip2-devel

2.checking for cURL support… yes checking if we should use cURL for url streams… no checking for cURL in default path… not found configure: error: Please reinstall the libcurl distribution – easy.h should be in/include/curl/
Fix: yum install curl-devel

3.checking for curl_multi_strerror in -lcurl… yes checking for QDBM support… no checking for GDBM support… no checking for NDBM support… no configure: error: DBA: Could not find necessary header file(s).
Fix: yum install db4-devel

4.checking for fabsf… yes checking for floorf… yes configure: error: jpeglib.h not found.
Fix: yum install libjpeg-devel
yum install libjpeg-devel -y;  ln -s /usr/lib64/libpng.so /usr/lib/

5.checking for fabsf… yes checking for floorf… yes checking for jpeg_read_header in -ljpeg… yes configure: error: png.h not found.
Fix: yum install libpng-devel

6. checking for png_write_image in -lpng… yes If configure fails try –with-xpm-dir=
configure: error: freetype.h not found.
Fix:
yum install freetype-devel
or
Reconfigure your PHP with the following option. --with-xpm-dir=/usr

7.checking for png_write_image in -lpng… yes configure: error: libXpm.(a|so) not found.
Fix: yum install libXpm-devel

8. checking for bind_textdomain_codeset in -lc… yes checking for GNU MP support… yes configure: error: Unable to locate gmp.h
Fix: yum install gmp-devel

9.checking for utf8_mime2text signature… new checking for U8T_DECOMPOSE… configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
Fix: yum install libc-client-devel

10. checking for LDAP support… yes, shared checking for LDAP Cyrus SASL support… yes configure: error: Cannot find ldap.h
Fix: yum install openldap-devel

11. checking for mysql_set_character_set in -lmysqlclient… yes checking for mysql_stmt_next_result in -lmysqlclient… no checking for Oracle Database OCI8 support… no checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
Fix: yum install unixODBC-devel

12.checking for PostgreSQL support for PDO… yes, shared checking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
Fix: yum install postgresql-devel

13. checking for sqlite 3 support for PDO… yes, shared checking for PDO includes… (cached) /usr/local/src/php-5.3.7/ext checking for sqlite3 files in default path… not found configure: error: Please reinstall the sqlite3 distribution
Fix: yum install sqlite-devel

14. checking for utsname.domainname… yes checking for PSPELL support… yes configure: error: Cannot find pspell
Fix: yum install aspell-devel

15checking whether to enable UCD SNMP hack… yes checking for default_store.h… no
   checking for kstat_read in -lkstat… no checking for snmp_parse_oid in -lsnmp… no checking for init_snmp in -lsnmp… no configure: error: SNMP sanity check failed. Please check config.log for more information.
Fix: yum install net-snmp-devel

16. checking whether to enable XMLWriter support… yes, shared checking for xml2-config path… (cached) /usr/bin/xml2-config checking whether libxml build works… (cached) yes checking for XSL support… yes, shared configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
Fix: yum install libxslt-devel

17.configure: error: xml2-config not found. Please check your libxml2 installation.
Fix: yum install libxml2-devel

18. checking for PCRE headers location… configure: error: Could not find pcre.h in /usr
Fix: yum install pcre-devel

19.configure: error: Cannot find MySQL header files under yes. Note that the MySQL client library is not bundled anymore!
Fix: yum install mysql-devel

20.checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
Fix: yum install unixODBC-devel

21.checking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
Fix: yum install postgresql-devel

22.configure: error: Cannot find pspell
Fix: yum install pspell-devel

23.configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.
Fix: yum install net-snmp-devel

24.configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
Fix: yum install libxslt-devel

25.configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Fix:rpm -ivh "http://www.lishiming.net/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm"
yum install -y libmcrypt-devel

26.configure: error: Cannot find OpenSSL's
Fix:yum  install  openssl openssl-devel -y

27. ./configure: /usr/local/apache2/bin/apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory
configure: error: Aborting
Fix:
首先安装perl
yum install -y perl
然后修改/usr/local/apache2/bin/apxs关于perl路径
vi  /usr/local/apache/bin/apxs
第一行的#!/replace/with/path/to/perl/interpreter -w,找到你perl的安装位置,如果不清楚,可以用which perl找到,一般在/usr/bin/perl ,于是将第一行改为:#!/usr/bin/perl -w. 再运行php的configure, 一切正常!

28.php安装出现以下问题
configure: error: xml2-config not found. Please check your libxml2 installation.
Fix:yum install libxml2 libxml2-devel -y


三、Apache常见错误信息的解决方法
1.Apache2.2安装 出现以下错误
configure: error: in `/usr/local/src/httpd-2.2.31/srclib/apr':
configure: error: no acceptable C compiler found in $PATH
解决方法:
yum install -y gcc

2.rm: cannot remove `libtoolT': No such file or directory(./configure --prefix=/usr/local/apr)
vi configure
找到RM='$RM'
把第29605行     RM='$RM' 改 RM='$RM  -f'

3.执行/usr/local/apache2/bin/apachectl -t
报以下错误
httpd: Could not reliably determine the server's fully qualified domain name, using 202.102.110.203 for ServerName
解决办法:
vi /usr/local/apache2/conf/httpd.conf
找到#ServerName www.example.com:80在下面添加一行
ServerName localhost:80
保存即可
2016-03-08 13:30 举报
已邀请:

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: