Description
Operating system: CentOS
PHP installation directory:/usr/local/php
PHP.ini configuration file path:/usr/local/php/etc/php.ini
Nginx installation directory:/usr/local/nginx
Nginx website root directory:/usr/local/nginx/html
System operation and maintenance www.osyunwei.com warm reminder: qihang01 original content copyright, reproduced please indicate the source and the original link
1. Install the Compilation tool
Yum install wget make gcc gcc-c++ zlib-devel OpenSSL openssl-devel pcre-devel kernel keyutils Patch Perl
2. Installing Redis
Download: https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
Upload phpredis-2.2.4.tar.gz to/usr/local/src directory
CD/USR/LOCAL/SRC #进入软件包存放目录
Tar zxvf phpredis-2.2.4.tar.gz #解压
CD phpredis-2.2.4 #进入安装目录
/usr/local/php/bin/phpize #用phpize生成configure配置文件
./configure--with-php-config=/usr/local/php/bin/php-config #配置
Make #编译
Make install #安装
After the installation is complete, the following installation path appears
/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
3. Configure PHP Support
Vi/usr/local/php/etc/php.ini #编辑配置文件, add the following on the last line
Add to
extension= "Redis.so"
: wq! #保存退出
4. Testing
vi/usr/local/nginx/html/index.php #编辑
<?php
Phpinfo ();
?>
: wq! #保存退出
Browser open index.php as shown, you can see information about Redis
At this point, Linux under the PHP installation of Redis completed!
Installing Redis extensions under Linux in PHP