Recently, learning to build a lamp service environment, the middle encountered a lot of problems, after continuous groping finally to solve. In order to make fewer detours, we will summarize relevant experience.
Linux Software installation is divided into automatic installation and manual installation of two kinds, automatic installation with tools such as Yum, automatic installation of files are often scattered in various directories, in order to facilitate management, here choose manual Installation
1. Installing Apache
1.1 Extract Apache to/usr/local/services directory tar zxvf httpd-2.0.63.tar.gz
1.2 Enter the httpd-2.0.63 directory, generate the makefile, and install Apache into the/usr/local/apache directory, specified by the prefix parameter
./configure--prefix=/usr/local/apache--enable-module=so, wherein: module installation There are two ways of static and dynamic, specific reference:
a.http://blog.csdn.net/chaijunkun/article/details/6977466--enable-module=so Parameter Description
B.http://blog.sina.com.cn/s/blog_6238358c01017gdu.html
(Note: Configuration parameters are important, otherwise you have to manually add later, more trouble)
1.3 Make
1.4 Make Install
1.5 Open the browser, enter "http://localhost" in the Address bar "It works!" appears or Apache icon with a nice interface that illustrates the success of Apache installation
2. PHP Installation
2.1 Get the support files needed to install PHP: http://xmlsoft.org/sources/libxml2-2.9.1.tar.gz and install LIBXML2
Tar zxvf libxml2-2.9.1.tar.gz
CD libxml2-2.9.1.
./configure--PREFIX=/USR/LOCAL/LIBXML2
Make
Make install
2.2 Installing PHP
Tar zvxf php-5.5.4.tar.gz
CD php-5.5.4
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--WITH-LIBXML-DIR=/USR/LOCAL/LIBXML2
Make
Make install
2.3 Configure Apache to let IT support PHP
Vi/usr/local/apache/conf/httpd.conf
Locate AddType application/x-gzip. gz. tgz below to add the following
AddType application/x-httpd-php. PHP (with spaces in front)
AddType Application/x-httpd-php-source. PHPS (front with spaces)
2.4 Copy the PHP configuration file
CP Php-5.5.4/php.ini.dist/usr/local/php/lib/php.ini
(If there is no php.ini.dist, rename any one of the php.ini-development php.ini-production to Php.ini.dist.) )
2.5 Restarting Apache
/usr/local/apache/bin/apachectl restart
2.6 Write a PHP test page info.php, put it in Apache/htdocs.
<?php
Phpinfo ();
?>;
Enter in Browser: Server address/info.php, if you can display the PHP information correctly, then apche+mysql+php installation is successful
An attempt to build the Linux lamp environment