1. Get installation files: http://www.php.net/downloads.php php-5.3.8.tar.gz
To obtain the support files needed to install PHP: http://download.csdn.net/download/netlong339/1351852 libxml2-2.6.32.tar.gz
2. Install LIBXML2
1 tar zxvf libxml2-2.6.32.tar.gz
2 cd libxml2-2.6.32
3./configure--PREFIX=/USR/LOCAL/LIBXML2
4
make 5 Make Install
If the installation is successful, the bin, include, Lib, man, and share five directories will be generated under the/usr/local/libxml2/directory. When you install the PHP5 source package configuration Later, you specify where to install LIBXML2 library files by adding the "--with-libxml-dir=/usr/local/libxml2" option to the Configure command.
3. Install PHP5
#tar zvxf php-5.3.8.tar.gz
#cd php-5.3.8
#./configure \
--prefix=/usr/local/php \
--with-mysql=/usr /local/mysql \
--with-apxs=/usr/local/apache2/bin/apxs \
--with-libxml-dir=/usr/local/libxml2
#make
4. Reconfigure apache2 let him support PHP configuration httpd.conf let Apache support php:
# vi/usr/local/apache/conf/httpd.conf
Find AddType application/x-gzip gz. tgz to add the following content below
AddType application/x-httpd-php. PHP (. Preceded by a space)
AddType Application/x-httpd-php-source Phps (. Preceded by a space) then cpopy PHP configuration file
CP Php-5.3.8/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.) )
Modify php.ini file Register_globals = on restart Apache
Service Apache Restart
5. Test whether PHP is installed successfully
Write a PHP test page info.php and put it into the apache2/htdocs.
<?php
Phpinfo ();
?>;
Enter in Browser: server address/info.php
If you can display PHP information correctly, the apche+mysql+php installation is successful.