Summary of compilation and installation problems in LAMP environment
apache:
Question:
Error mod_deflate has been requested but can not be built due to prerequisite failures
Solution:
Zlib package is not installed. Run command:
yum install zlib-devel
PHP:
Question:
mcrypt.h not found. Please reinstall libmcrypt
yum install libmcrypt libmcrypt-devel compiled, or error.
Solution:
When compiling PHP, --with-mcrypt=/usr/local/libmcrypt/adds the mcrypt path. It solves the problem.
./ 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
Question:
configure: error: xml2-config not found. Please check your libxml2 installation.
Solution:
yum install -y libxml2-devel
Summary: Before compiling and installing LAMP, install the libraries that need to be installed in advance with yum. Avoid making mistakes.
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
If you encounter problems again, follow the error prompt. Resolved. Common problems are caused by a lack of libraries required for installation.