Install php 5.6 and redis extension in CentOS 6.x

Source: Internet
Author: User
Tags install redis

Install php 5.6 and redis extension in CentOS 6.x

Install PHP 5.6

#yumcleanall# Yumupdate upgrade the yum package#yuminstall-yepel-release# Yumlistinstalled | PHP installed during grepphp check#rpm-Uvhhttp://mirror.webtatic.com/yum/el6/latest.rpm#yum-yinstallphp56w.x86_64#yum-y--enablerepo=webtaticinstallphp56w-devel#yum-yinstallphp56w-xml.x86_64php56w-gd.x86_64php56w-ldap.x86_64php56w-mbstring.x86_64php56w-mcrypt.x86_64php56w-mysql.x86_64php56w-pdo.x86_64php56w-opcache.x86_64#yum-yinstallphp56w-fpm# Chkconfigphp-fpmon Automatic startup#/Etc/init. d/php-fpmstart Start Process# Php-v check whether the installation is successful

Note 1: If you want to change to php5.5 or 5.4, you can change the 56 W to 55 W or 54w;

NOTE 2: php-opcache and php-xcache can effectively improve the php Execution speed;

Installing php extensions is not very troublesome. The main steps are as follows:

1) Use phpize in the client folder of the extension module to generate a configure file;

2) execute the configure file, followed by the php path;

3) add the "module. so" file name to the php. ini file and restart the php-fpm process;

4) use the so file to call the client of the extension module to connect to the corresponding module;

Install redis Extension

# Redis-cli-v check whether redis is installed#redis-server-v#wgethttp://pecl.php.net/get/redis-2.2.8.tgz#tar-zxvfredis-2.2.8.tgz#cdredis-2.2.8# Phpize is a specialized php extension tool. This command must be used in the main directory of the php module folder. The error Cannotfindconfig. m4 is reported here. Because phpize should be placed under the module folder according to the module configuration file generated by the module

#./configure--with-php-config=/usr/bin/php-config#make&&makeinstall#maketest# Vim/etc/php. ini Add "extension =" redis. so "in php. ini ""#servicephp-fpmrestart

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.