System environment: Centos6.0 x64
1. Confirm that the environment required to build the lamp has been installed
[ROOT@CENTOS6 ~]# rpm-q make gcc gcc-c++ zlib-devel Libaio
Note: installation libpng need zlib-devel
Need Libaio when installing MySQL
2, if not installed then Yum installation
[ROOT@CENTOS6 ~]# yum install make gcc gcc-c++ zlib-devel libaio-y
3, because to use the compilation installation, so see httpd, MySQL, PHP is installed, if the installation is uninstalled
[Root@centos6 ~]# rpm-q httpd mysql PHP
4. Compile and install LIBXML2
Note: LIBXML2 is an XML C language parser that supports not only C but also the binding of C + +, PHP, Pascal, Ruby, Tcl and other languages.
[Root@centos6 lamp]# pwd
/tmp/lamp
[Root@centos6 lamp]# TAR-ZXVF libxml2-2.7.8.tar.gz
[Root@centos6 lamp]# CD./libxml2-2.7.8
[Root@centos6 libxml2-2.7.8]#./configure--prefix=/usr/local/libxml2/
[ROOT@CENTOS6 libxml2-2.7.8]# Make;make Install
5. Compile and install Libmcrypt
Note: Libmcrypt is a cryptographic algorithm extension library. Supports DES, 3DES, RIJNDAEL, Twofish, Idea, GOST, CAST-256, Arcfour, Serpent, safer+, and other algorithms.
[Root@centos6 lamp]# pwd
/tmp/lamp
[Root@centos6 lamp]# TAR-ZXVF libmcrypt-2.5.8.tar.gz
[Root@centos6 lamp]# CD./libmcrypt-2.5.8
[Root@centos6 libmcrypt-2.5.8]#./configure--prefix=/usr/local/libmcrypt/
[ROOT@CENTOS6 libmcrypt-2.5.8]# Make;make Install
6. Compile and install Zlib
Note: zlib is a function library for data compression
[Root@centos6 lamp]# pwd
/tmp/lamp
[Root@centos6 lamp]# TAR-ZXVF zlib-1.2.5.tar.gz
[Root@centos6 lamp]# CD./zlib-1.2.5
[Root@centos6 zlib-1.2.5]#./configure--prefix=/usr/local/zlib/
[Root@centos6 zlib-1.2.5]# make; Make install
7. Compile and install libpng
[Root@centos6 lamp]# pwd
/tmp/lamp
[Root@centos6 lamp]# TAR-ZXVF libpng-1.5.4.tar.gz
[Root@centos6 lamp]# CD./libpng-1.5.4
[Root@centos6 libpng-1.5.4] #
./configure--prefix=/usr/local/libpng/--enable-shared
[Root@centos6 libpng-1.5.4]# make; Make install