Linux under the PHP source installation

Source: Internet
Author: User

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

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.