Install Redis extension in PHP7

Source: Internet
Author: User

Install Redis extension in PHP7

Install Redis extension in PHP7

1. Install redis

(1) download: https://github.com/phpredis/phpredis/tree/php7 or download http://pan.baidu.com/s/1i5dfrjnuse sambato Import

(2) yum-y install m4 autoconf # install Dependencies

(3) unzip phpredis-php7.zip # Extract

(4) cd./phpredis-php7 # enter the Directory

(5) phpize # Use phpize to generate the configure configuration file

(6)./configure -- with-php-config =/usr/local/php7/bin/php-config # Configuration

(7) make # compile

(8) make install # install

(9) vim/usr/local/php7/etc/php. ini # edit the configuration file and add extension = "redis. so"

[root@localhost phpredis-php7]# ps -aux | grep phproot       1572  0.0  0.6 212856  6032 ?        Ss   13:40   0:00 php-fpm: master process (/usr/local/php7/etc/php-fpm.conf)nginx      1608  0.0  0.5 212856  5588 ?        S    13:40   0:00 php-fpm: pool wwwnginx      1609  0.0  0.5 212856  5588 ?        S    13:40   0:00 php-fpm: pool wwwroot       5376  0.0  0.0 112648   972 pts/0    R+   13:50   0:00 grep --color=auto php

Find the PHP process to smoothly start kill-USR2 1572 view phpinfo

2. PHP Program

$redis = new Redis();$redis->connect('127.0.0.1','6379');$redis->set(1,2);$res = $redis->get(1);var_dump($res);die;

Compile and install Apache2.4 and PHP7 in Ubuntu 16.04

Install a Web Server on Ubuntu Server 14.04 (Linux + Apache + MySQL + PHP)

Install and configure the PHP environment in Linux (Apache2)

Compile and install LAMP in CentOS 5.9 (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12)

This article permanently updates the link address:

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.