Operating system: CentOS6.5 environment: Apache2.2 installed successfully. for details, refer to: success.
Operating system: CentOS6.5
Environment: Apache2.2 installed successfully, you can view: http://www.centoscn.com/image-text/install/2014/0505/2910.html
Mysql5.5 has been installed successfully, you can view: http://www.centoscn.com/image-text/install/2014/0505/2911.html
1. Download php source code
Http://www.php.net/downloads.php
2. Select: php-5.3.28.tar.gz
3. after the download is complete, upload it to the/root folder of linux.
4. cd/root
Tar-zxvf php-5.3.28.tar.gz
Cd php-5.3.28
. /Configure -- prefix =/usr/local/php5 -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-config-file-path =/usr/local/lib -- enable-track-vars -- with-xml
Tip: configure: error: xml2-config not found. Please check your libxml2 installation.
Before installing PHP, we recommend that you first install the latest library files required by PHP5, such as libxml2, libmcrypt, and GD2. To enable PHP5 to support GIF, PNG, and JPEG image formats, install the latest library files such as zlib, libpng, freetype, and javassrc before installing the GD2 Library.
Autoconf-2.61.tar.gz
Freetype-2.3.5.tar.gz
Gd-2.0.35.tar.gz
Jpegsrc.v6b.tar.gz
Libmcrypt-2.5.8.tar.gz
Libpng-1.2.31.tar.gz
Libxml2-2.6.30.tar.gz
Zlib-1.2.3.tar.gz
ZendOptimizer-3.2.6-linux-glibc21-i386.tar.gz
PhpMyAdmin-3.0.0-rc1-all-languages.tar.gz5.
Install libxml2-2.7.8.tar.gz
Libxml2-2.7.8.tar.gz
Download: http://download.chinaunix.net/download.php? Id = 35177 & ResourceID = 6095
Cd/root
Tar-zxvf libxml2-2.7.8.tar.gz
Cd libxml2-2.7.8
./Configure -- prefix =/usr/local/libxml2/
// The installation may fail.
Rpm-aq | grep-I libxml check whether the system has been installed
Libxml2 installation error:
Cannot remove 'libtoolt': No such file or directory
Solution:
Modify the configure file
$ Vim configure
Delete this row: $ RM "$ deleted File"
Run $./configure again.
Make
Make install
Re-execute:
./Configure -- prefix =/usr/local/php5 -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-config-file-
Path =/usr/local/php5/etc/php. ini -- with-mysql = mysqlnd -- with-mysqli = mysqlnd -- with-pdo-
Mysql = mysqlnd -- without-pdo-sqlite -- without-sqlite3 -- without-sqlite -- enable-mbstring ---
Openssl -- with-mhash -- with-mcrypt -- with-gettext -- with-zlib-dir =/usr/local/zlib -- enable-zip --
Enable-sockets -- enable-soap -- with-xmlrpc -- with-libxml-dir -- with-zlib =/usr/local/zlib/-- with-mysql =/usr/local/mysql -- with-mcrypt
Make install successful:
5. configure apache and php integration
Cp/usr/local/src/php-5.3.16/php. ini-development/usr/local/php/lib/php. ini
Copy the php. ini-development in the source code to/usr/local/php/lib/php. ini and rename it php. ini.
# Set the default file name order of apache
# AddType application/x-httpd-php. php. phtml. php3. inc
# AddType application/x-httpd-php-source. phps
# Set the php file suffix
Save disk and exit
Vi/usr/local/lib/php. ini
# Register-golbals = On
Save disk and exit
6. test php
Test: compile the test. php file with the following content:
Enter http: // 127.0.0.1/test. php in the browser.