LAMP架构编译安装过程中遇到的错误

做运维工作一年了,中间遇到了 各种各样的错误,可惜的是没有将这些错误积累下来形成自己的文档,现在开始记录,从最简单的开始,记录一下我在编译安装LAMP架构过程中遇到的错误吧。

编译安装php-5.3.10, ./configure --with-apxs2 --disable-ipv6 --with-openssl=/usr --with-libxml-dir=/usr --with-zlib=/usr --with-bz2=/usr --with-curl=/usr --enable-ftp --with-mssql=/usr/local/mysql --with-mysql-sock=/var/run/mysqld/mysql5.socket --with-mysqli=/usr/local/mysql/bin/mysql_config

报错configure: error: xml2-config not found. Please check your libxml2 installation

错误原因,xml2-config这个文件没找到,所以需要重装libxml2-devel,为方便我直接安装所有包 yum install libxml2* -y。

继续编译出现另一个错误configure: error: Please reinstall the BZip2 distribution

错误原因,没有装bzip2

yum install bzip2 bzip2-devel -y

继续编译出现另一个错误configure: error: Directory /usr/local/mysql is not a FreeTDS installation directory

错误原因php找不到freetds的安装路径



编译安装mysql-5.1.36.tar.gz

./configure --prefix=/usr/local/mysql --enable-local-infile --with-charset=gbk --with-extra-charsets=gb2312,utf8 --with-server-suffix='-myclass' --with-pthread --with-unix-socket-path=/var/run/mysqld/mysql5.socket --with-tcp-port=3306 --with-mysqld-user=mysql --with-zlib-dir=/usr --with-debug --with-low-memory --with-big-tables --with-plugins=heap,innobase,myisam,myisammrg,ndbcluster --with-ndb-docs

报错1configure: error: No curses/termcap library found

需要安装curses和termcap

yum install -y libtermcap-devel *curses*

./configure通过后进行make出现错误2

./depcomp: line 512: exec: g++: not found
make[2]: *** [my_new.o] 错误 127
make[2]: Leaving directory `/usr/local/setup/mysql-5.0.51b/mysys'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/usr/local/setup/mysql-5.0.51b'
make: *** [all] 错误 2
[root@gameserver mysql-5.0.51b]# yum install -y gcc-c++


解决办法:
yum install -y gcc-c++

../include/my_global.h:1088: 错误:对 C++ 内建类型 ‘bool’ 的重声明

是的话 重新./configure 在make clean make make install 就解决了