Linux Installation Configuration Php____linux

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.