LAMP环境编译安装问题总结

apache:

问题:

安装apache的时候入到 error: mod_deflate has been requested but can not be built due to prerequisite failures的错误。

解决:

没有安装zlib包。运行命令:

yum install zlib-devel


PHP:

问题:

编译安装php出错mcrypt.h not found. Please reinstall libmcrypt

yum install libmcrypt libmcrypt-devel之后编译,还是报错。

解决:

编译PHP时, --with-mcrypt=/usr/local/libmcrypt/ 加入mcrypt路径。即可解决问题。

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt=/usr/local/libmcrypt/ --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif --disable-ipv6


问题:

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

解决:

yum install -y libxml2-devel

总结:编译安装LAMP前,把事先需要安装的库用yum安装下。避免发生一些错误。
yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
再遇到问题,根据错误提示。解决。一般问题都是因为缺少安装所需要的库导致。

你可能感兴趣的:(lamp)