Install configuration Apache2+php5+memecache in CentOS

Source: Internet
Author: User
Tags curl ini mysql client openssl centos

Part of the use of Yum installation, you need to download the following:
Apr,apr-util,pcre,httpd,php5,eaccelerator

First use Yum to install the dependent program:

The code is as follows Copy Code

Yum Install GD zlib-devel freetype libjpeg* libpng* php-gd libxml2
Libxml2-devel Curl-devel Openssl-devel Php-mysql

Since the computer is not installed mysql,php want to connect to MySQL, you must install the MySQL client, where Php-mysql is installed
After downloading the required packages, use TAR-ZXVF file.tar.gz decompression, the configuration of each software and compile commands as follows:

The code is as follows Copy Code

Apr

#./configure--PREFIX=/USR/LOCAL/APR
# Make && make install

Apr-util


#./configure\
--prefix=/usr/local/apr-util\
--with-apr=/usr/local/apr/bin/apr-1-config
# Make && make install

Pcre

./configure--prefix=/usr/local/pcre
Make && make install
httpd

#./configure\
--prefix=/usr/local/apache2\
--with-included-apr\
--with-apr=/home/apr-1.5.1\
--with-apr-util=/home/apr-util-1.5.3\
--enable-so\
--enable-mods-shared=most\
--with-pmp=worker\
--with-pcre=/usr/local/pcre\
--with-ssl\
--enable-ssl\
--enable-rewrite
# Make && make install
/usr/local/apache2/bin/apachectl-k start starts Apache
/usr/local/apache2/bin/apachectl-k Stop/restart stop or restart Apache
PhP5

#./configure\
--prefix=/usr/local/php\
--with-apxs2=/usr/local/apache2/bin/apxs\
--with-mysql\
--with-mysqli\
--with-pdo-mysql\
--with-curl\
--with-mcrypt\
--enable-mbstring\
--with-iconv\
--with-freetype\
--with-gd\
--with-jpeg\
--with-png\
--enable-sockets\
--with-zlib\
--enable-zip\
--enable-soap\
--enable-shared\
--with-xmlprc\
--with-libxml\
--enable-xml\
--enable-bcmath\
--with-openssl

# Make && make install
Modify httpd.conf, add the following current
LoadModule Php5_module modules/libphp5.so
AddType application/x-httpd-php. php
To restart Apache.
Memecache

#/usr/local/php/bin/pecl Install Memcache
Add the memcache.so generated above to the php.ini file, like this:
extension= "/usr/local/php/lib/php/extensions/no-debug-zts-20100525/memcache.so"
Eaccelerator


#./configure\
--enable-eaccelerator=shared\
--with-php-config=/usr/local/php/bin/php-config

Also add the generated eaccelerator.so to the php.ini file


A minor problem with the installation is that the Yum installation package prompts key error

CentOS Yum The solution to prompt key error when installing package

Yum Install pptpd--NOGPG

Related Article

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.