Home >Backend Development >PHP Tutorial >How to add redis extension to php under ubuntu system

How to add redis extension to php under ubuntu system

黄舟
黄舟Original
2017-10-18 09:05:061612browse

This article mainly introduces the relevant information on the implementation method of adding redis extension to PHP on the Ubuntu system. I hope this article can help everyone to realize such a function. Friends who need it can refer to it

How to implement the redis extension for PHP on the ubuntu system

In a recent project, I wanted to use redis as the database. PHP does not require the redis extension and must be installed. How to install it? A lot of information I found on the Internet was pre-compiled, but failed, so I found another method that can be installed directly without compilation.

Install redis extension


sudo apt-get install git-core

After installation, restart nginx,php5-fpm,

Restart nginx


sudo /etc/init.d/nginx restart

Restart php5-fmp


##

sudo /etc/init.d/php5-fpm restart

phpinfo is displayed on the web page:


reids See if there is


php. To operate redis, you must install the redis client



sudo apt-get install redis-server

You can experience it now.

Okay, it’s time to go to bed. I have to get up tomorrow to grab tickets. I’m back home for the Spring Festival. Life is like this. Once you decide, you have to pursue it without hesitation. Sometimes dreams always seem so out of reach. , bite it, hold on, everything will be connected.                                                                                           

The above is the detailed content of How to add redis extension to php under ubuntu system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn