1. Installation Preparation
(1) Download PHP package
http://cn2.php.net/downloads.php
(2) Installing PHP
# TAR-ZXVF Php-5.6.10.tar.gz
# CD php-5.6.10
#./configure--prefix=/usr/local/php--enable-fpm--enable-mbstring--with-mysql=/usr/local/mysql--with-apxs2=/usr /LOCAL/APACHE2/BIN/APXS #注意指定apache安装路径及 MySQL installation directory
#--with-mysqli=/usr/local/mysql/bin/mysql_config
# make
# make instal
# Make Clean #清除编译后文件
# Make Distclean #彻底清除编译后文件
If you are prompted with an error: Configure:error:xml2-config not found. Please check your LIBXML2 installation.
Workaround:
# yum Install LIBXML2
# Yum Install Libxml2-devel are installed on
(3) PHP module loaded in Apache
# CP Php.ini-dist/usr/local/php/lib/php.ini
Modify the php.ini. Find Date.timezone Remove the previous semicolon modification to become: Date.timezone =PRC
# vim/usr/local/apache2/conf/httpd.conf
See if there are any of the following words, no then add
LoadModule Php5_module modules/libphp5.so
Find "#AddType application/x-gzip. Gz. tgz" Add
AddType application/x-httpd-php. php. phtml
AddType Application/x-httpd-php-source. Phps
#加入后缀名过滤
AddHandler application/x-httpd-php. php
#或者以下配置应用过滤
<filesmatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
(4) Build PHP test files
# vim/usr/local/apache2/htdocs/test.php
<?php
Phpinfo ();
?>
: Wq
(5) Restart Apache Service
/usr/local/apache2/bin/apachectl restart
This article is from the "Home_tang" blog, make sure to keep this source http://yagetang.blog.51cto.com/1780698/1670248
Linux under the PHP source installation