Linux Installation configuration PHP environment method, Linux installation configuration PHP
The examples in this article describe how Linux installs the PHP environment. Share to everyone for your reference, as follows:
1. Get the installation file : http://www.php.net/downloads.php php-5.3.8.tar.gz
Get the support files you need to install PHP: http://download.csdn.net/download/netlong339/1351852 libxml2-2.6.32.tar.gz
2. Installing LIBXML2
Copy the Code Code as follows: Tar zxvf libxml2-2.6.32.tar.gz
CD libxml2-2.6.32
./configure--PREFIX=/USR/LOCAL/LIBXML2
Make
Make install
If the installation succeeds, the bin, include, Lib, man, and share five directories will be generated under the/usr/local/libxml2/directory. When you install the configuration of the PHP5 source package later, you specify the location where the LIBXML2 library files are installed by adding the "--with-libxml-dir=/usr/local/libxml2" option in the options for the Configure command.
3. Installing PHP5
Copy the Code code as follows: #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 \
--ENABLE-FASTCGI \
--enable-fpm
#make
#make Install
4. Reconfigure apache2 to let him support PHP
① configuration httpd.conf let Apache support PHP:
Copy the Code code as follows: # 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)
② then cpopy the PHP configuration file
Copy the Code Code as follows: 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 the php.ini file copy code code as follows: Register_globals = On
③ Restart Apache
Copy the Code Code as follows: Service Apache restart
5. Test if PHP is installed successfully
Write a PHP test page info.php, and put it in Apache2/htdocs.
<?php phpinfo ();? >
Enter in Browser: server address/info.php
If the PHP information can be displayed correctly, the apche+mysql+php installation is successful!
I hope this article is helpful to you in PHP programming.
Articles you may be interested in:
- Install configuration Nginx Server +php development environment from scratch under Linux
- Linux Apache PHP Oracle Installation Configuration (detailed procedure)
- Linux Apache, MySQL, PHP installation configuration detailed notes
- Installation configuration of LANMP (Linux Apache Nginx Mysql Php)
http://www.bkjia.com/PHPjc/1091851.html www.bkjia.com true http://www.bkjia.com/PHPjc/1091851.html techarticle Linux Installation configuration PHP environment method, Linux installation configuration PHP This article describes the Linux installation method of configuring the PHP environment. Share to everyone for your reference, as follows: 1. Get the installation text ...