Lamp architecture is one of the most mature enterprise Web application models, which refers to a set of systems and related software that can provide dynamic Web site service and its application development environment. The word lamp is an abbreviation, which includes: Linux system, Apache Web server, MySQL database, PHP Web programming language.
component of Lamp Platform
Linux: As the base of the lamp architecture, provides the operating system to support the Web site, and can provide better stability and compatibility with three other components.
Apache: As a lamp structure front-end, is a powerful, stable Web server program, the server directly to provide users with Web site access, send Web pages, pictures and other file content.
MySQL: As the back end of lamp architecture, it is a popular open source relational database system.
PHP: As a programming language for developing dynamic Web pages, it is responsible for interpreting dynamic Web page files and providing Web applications for program development and running environments.
In the previous several articles, has explained in detail how to install Apache and MySQL, so here is not detailed said, now only to build a good PHP operating environment can be composed of lamp platform. Note: When building the lamp platform, the installation sequence of each component is Linux, Apache, MySQl, PHP. The installation of Apache and MySQL is not in strict order, and the installation of PHP environment is generally put in the last, responsible for communication Web server and database system to work together.
Build PHP Running Environment
1. Preparation work
If you have a previous PHP with the ". RPM" Package installed on the server, you will need to uninstall it here, or there will be a procedural conflict.
[Root@localhost/] #rpm-e php php-cli php-ldap php-common php-mysql--npdeps
Download the PHP source package, through the official PHP site http://www.php.net./downloads Download the latest source package, the author used this is the 5.3 version.
2, install the Extension tool Library
In the actual enterprise application, part of the Web application system based on PHP will require additional extension tools, such as data encryption tools Libmcrypt, Mhash, MCrypt, etc. (can be downloaded from the site http://wwwsf.net). Before installing the PHP package, you should install these extension tools first.
Install Libmcrypt
[Root@localhost Media] #tar zxf libmcrypt-2.5.8.tar.gz-c/user/src/
[Root@localhost Media] #cd/usr/src/libmcrypt-2.5.8/
[Root@localhost libmcrypt-2.3.8]#./configure
[Root@localhost libmcrypt-2.3.8]#.make && make install
[Root@localhost libmcrypt-2.3.8]#.ln-s/usr/local/lib/libmcrypt.*/usr/lib/
Install Mhash
[Root@localhost Media] #tar zxf mhash-0.9.9.9.tar.gz-c/user/src/
[Root@localhost Media] #cd/usr/src/mhash-0.9.9.9/
[Root@localhost libmcrypt-2.3.8]#./configure
[Root@localhost libmcrypt-2.3.8]#.make && make install
[Root@localhost libmcrypt-2.3.8]#.ln-s/usr/local/lib/libmhash*/usr/lib/
Install MCrypt
[Root@localhost Media] #tar zxf mcrypt-2.6.8.tar.gz-c/user/src/
[Root@localhost Media] #cd/usr/src/mcrypt-2.6.8/
[Root@localhost libmcrypt-2.3.8]#./configure
[Root@localhost libmcrypt-2.3.8]#.make && make install
Note: You will not be able to install the PHP package until you install the three extension tools, and you should be aware of the order of installation when installing these three extensions.