CentOS Apache PHP Installation

Source: Internet
Author: User

1. Download

wget http://apache.fayea.com/apache-mirror//httpd/httpd-2.2.29.tar.gz
Tar zxvf httpd-2.2.29.tar.gz
CD httpd-2.2.29
./configure--PREFIX=/USR/LOCAL/HTTPD (You can also specify your own path)
Make && make install

/usr/local/httpd/bin/apachectl start

Register as a service

Cp/usr/local/httpd/bin/apachectl/etc/rc.d/init.d/httpd

Ln-s/etc/rc.d/init.d/httpd/etc/rc.d/rc3.d/s61httpd

This allows you to use sevice httpd to manage the

2. Modify the script to support Chkconfig

Edit the httpd script and add the following comment information on line 2nd:

# CHKCONFIG:35 61 61

# Description:apache

Save after execution: Chkconfig--add httpd

The 3 parameters for the first line are: at which RunLevel, start httpd (3,5), start sequence number (S61), and close ordinal (K61). Note: The above two lines are indispensable

Rc5.d links will appear in the RC3.D, s61httpd path in the future after executing chkconfig--add httpd, and k61httpd links will appear in the other run level paths

2.php Installation

wget http://cn2.php.net/get/php-5.3.29.tar.gz/from/this/mirrortar zxvf phpcd phpyum Install gd*./configure--prefix=/ usr/local/php--with-mysql=mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-apxs2=/usr/local/httpd/ Bin/apxs--WITH-GD--enable-mbstring
Make && make install
cd/usr/local/php
Cp/usr/local/src/php-5.3.29/php.ini-development./lib/php.ini
Apache configuration file 311 left or right
AddType application/x-httpd-php. php. phtml
Plus the default index.php

CentOS Apache PHP 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.