Compiling and installing HPH

Source: Internet
Author: User

First, installation-related dependencies:

Yum Install GCC GCC bzip2-devel libjpeg-devel libpng-devel freetype-devel

Second, unzip the PHP installation package php-5.6.22.tar.gz

tar -xzvf php-5.6. . tar. gz-c/usr/src/

Third, compile and install PHP

cd/usr/src/php-5.6. /./configure--prefix=/usr/local/php5.6/--with-config-file-path=/usr/local/php5.6/etc-- WITH-CONFIG-FILE-SCAN-DIR=/USR/LOCAL/PHP5.6/ETC/PHP.D--with-mysql=/usr/local/mysql/--with-openssl--with-mysqli =/usr/local/mysql/bin/mysql_config--enable-mbstring--enable-bcmath--with-freetype-dir--with-jpeg-dir-- With-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--enable-sockets--with-apxs2=/usr/local/httpd/bin/ Apxs--with-bz2--enable-maintainer-zts--with-gd--with-gettext && make && make install

Iv. Check if PHP is installed as a httpd module

grep --color php

V. Copy the PHP configuration file

CP /usr/src/php-5.6. /php.ini-production/usr/local/php5.6/etc/php.ini

Vi. Modify the httpd configuration file to enable httpd to process PHP files

vim/usr/local/httpd/conf/http.conf/http Add addtype application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps

Modify
DirectoryIndex index.php index.html

Seven, make a home file index.php to test whether PHP is installed successfully

mv /usr/local/httpd/htdocs/index.html/usr/local/httpd/htdocs//usr/local/httpd/htdocs/  index.phphead></head><body><? php phpinfo ();? ></body>

Eight. Start httpd and check if PHP page is active

Compiling and installing HPH

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.