Yum installs Apache PHP to enable PHP to support memcached extensions

Source: Internet
Author: User
Tags apache php mcrypt

When it comes to new projects in the company, both the production environment and the test environment will allow operations to install the PHP environment (LAMP/LNMP) and allow PHP to support memcached extensions. The main building PHP environment here is to build Apache and PHP. MySQL is generally used in separate databases and not on the same server. Seemingly simple things, in the construction of the time, but also really encountered a lot of problems, to this record, convenient for you to transport students.

I. 163 and the default image source Some packages cannot be downloaded, using Ali's Mirror source

See this blog address: http://www.cnblogs.com/lzcys8868/p/7532569.html

two. webtatic Library must be installed

Centos 5.XRPM-UVH http://mirror.webtatic.com/yum/el5/latest.rpmCentOs 6.xRPM-UVH http://mirror.webtatic.com/yum/el6/latest.rpm CentOs 7.XRPM-UVH https://mirror.webtatic.com/yum/el7/epel-release.rpmRPM-UVH https://mirror.webtatic.com/yum/el7/webtatic-release.rpmthree. Yum installation httpd and its extensions1. Installing the httpd and its extensionsyum–y Install httpd httpd-develyum-y Install httpd-manual mod_ssl mod_perl mod_auth_mysql2.set boot up Apachechkconfig--levels 235 httpd on3.launch ApacheService httpd Start

Four.Install the php5.5 version. PHP requires the use of 5.5. Yum is installed by default with php5.31. Installing php5.5yum-y Install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64 php55w-develError: error:package:php55w-mcrypt-5.5.38-1.w6.x86_64 (webtatic)requires:libmcrypt.so.4 () (64bit)You could try using--skip-broken to work around the problemYou could try Running:rpm-va--nofiles--nodigest

2. Error message missing libmcrypt.so this library. Installing Libmcrypt,libmcrypt-devewget http://mirrors.hust.edu.cn/epel//6/x86_64/epel-release-6-8.noarch.rpm RPM-IVH epel-release-6-8.noarch.rpmrpm--import/etc/pki/rpm-gpg/rpm-gpg-key-centos-6yum-y Install Libmcrypt libmcrypt-devel

3. After reinstalling the php5.5 4. Installing the php-fpm5.5 moduleyum-y Install php55w-fpm Php55w-common

Five. First build memcached server, see this blog address:http://www.cnblogs.com/lzcys8868/p/7532615.html The installation package uses the following versionmemcached Service-side installation package:memcached-1.4.0.tar.gzlibevent-2.0.22-stable.tar.gzPHP supports memcached extension installation package:memcached-2.2.0.tgzlibmemcached-1.0.18.tar.gz   installation package: Link: http://pan.baidu.com/s/1eS8f1Yy Password: ph4bLink: http://pan.baidu.com/s/1gfo05CB Password: 1qdn       Six. php extension memcachedPHP extension memcache, does not support CAs, so we want to install memcached extension, memcached extension is based on libmemcached, so we will first installed libmemcached[[email protected] soft]# lsmemcached-1.4.0.tar.gzlibevent-2.0.22-stable.tar.gz memcached-2.2.0.tgzlibmemcached-1.0.18.tar.gz[[email protected] soft] #tar XF libmemcached-1.0.18.tar.gz-c/usr/src[email protected] soft]# cd/usr/src/libmemcached-1.0.18/[email protected] libmemcached-1.0.18]#/configure--prefix=/usr/local/libmemcached--with-memcached=/usr/ Local/memcached/bin/memcached[[email protected] libmemcached-1.0.18]# make && make install[email protected] libmemcached-1.0.18]# cd/root/soft/[email protected] soft]# tar XF memcached-2.2.0.tgz-c/usr/src/[email protected] soft]# cd/usr/src/memcached-2.2.0/[email protected] memcached-2.2.0]#/usr/bin/phpize[email protected] memcached-2.2.0]#/configure--with-php-config=/usr/bin/php-config--with-libmemcached-dir= /usr/local/libmemcached Error1:no, Sasl.h is not available. Run Configure WITH–DISABLE-MEMCACHED-SASL To disable this check

If the Errro1 error is reported, follow the lead

[email protected] memcached-2.2.0]#/configure--with-php-config=/usr/bin/php-config--with-libmemcached-dir= /usr/local/libmemcached--DISABLE-MEMCACHED-SASL--with-zlib-direrror2:memcached support requires ZLIB. Use--with-zlib-dir=<dir> to specify the prefix where zlib headers and library is locatedIf the Error2 error is reported, the following method is used to resolveYum install libmemcached libmemcached-develYum install zlib zlib-devel

After the error is resolved, compile and install

[[email protected] memcached-2.2.0]# make && make install//the following line appears, indicating that the compilation is installed correctlyInstalling shared extensions:/usr/lib64/php/modules/[email protected] memcached-2.2.0]# Vim/etc/php.ini//Added at the endextension=memcached.so[email protected] memcached-2.2.0]# php-m | grep memcached//See if there is a memcached extensionmemcached

Yum installs Apache PHP to enable PHP to support memcached extensions

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.