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: