


Php-Redis installation test notes, php-redis test notes
Back-end development uses PHP to operate redis. Here, the problems encountered during the installation and testing process are summarized and recorded. , for future reference! (The system is ubuntu)
1.redis installation
Download address: http://download.redis.io/releases/
Unzip and install:
Copy code The code is as follows:
tar -xvf redis-2.8.17.tar.gz
make
sudo make install
For ease of use, create a redis directory in the /usr directory and copy the following files to the /usr/redis/ directory:
Copy code The code is as follows:
/yourdir/redis-2.8.17/redis.conf
/yourdir/redis-2.8.17/src/redis-benchmark
/yourdir/redis-2.8.17/src/redis-server
/yourdir/redis-2.8.17/src/redis-cli
Of course, you can also use soft connections to achieve the purpose of convenient use. In addition, you can also add redis-server to startup, which is omitted here.
2.redis test
1) First open the redis server program
To facilitate testing, we modified the values of loglevel and logfile in the redis.conf configuration file as follows:
loglevel debug
logfile “/tmp/redis.log”
jay13@ubuntu:/usr/redis$ redis-server redis.conf
2) Open the redi client and perform addition, deletion, modification and query operations in the redis database through the client. The logs generated during the entire operation can be viewed in /tmp/redis.log.
Taking the simplest key operation as an example, the example is as follows:
Copy code The code is as follows:
jay13@ubuntu:/usr/redis$ redis-cli
127.0.0.1:6379> set jay13 jb51.net
OK
127.0.0.1:6379> set jay hello,world
OK
127.0.0.1:6379> get jay
"hello,world"
127.0.0.1:6379> get jay13
"jb51.net"
127.0.0.1:6379> del jay
(integer) 1
127.0.0.1:6379> get jay
(nil)
127.0.0.1:6379> set jay13 www.jb51.net
OK
127.0.0.1:6379> get jay13
"www.jb51.net"
3. Install phpredis extension
When using sudo apt-get install php5 to install php, phpize is not installed by default. When we install phpredis, we need to use phpize, so we need to install phpize first.
1) We get phpize by installing php developer tools. Just execute the following command:
Copy code The code is as follows:
sudo apt-get install php5-dev
2) Get the phpredis source file
The latest phpRedis address: https://github.com/nicolasff/phpredis
When installing as follows following the instructions on GitHub,
Copy code The code is as follows:
phpize
./configure --enable-redis-igbinary
make && make install
The following error description may appear:
Copy code The code is as follows:
checking for igbinary includes... configure: error: Cannot find igbinary.h
This is because we do not have the igbinary extension, which is something that phpredis depends on.
Ok, how to install igbinary?
The installation cannot be completed using apt-get. We install it by downloading the installation file.
Copy code The code is as follows:
wget http://pecl.php.net/get/igbinary-1.1.1.tgz a>
tar -xzvf igbinary-1.1.1.tgz
cd igbinary-1.1.1
phpize
./configure # No need for extra config params
make
make install
After installing igbinary, you can use the following command to install phpredis.
Copy code The code is as follows:
phpize
./configure –enable-redis-igbinary
make && make install
At this point, the installation is complete.
We modify the php.ini configuration file and add the two extensions we just installed to the php.ini file. The added statements are as follows:
Copy code The code is as follows:
extension=igbinary.so
extension=redis.so
Restart apache, Done! ! !
4. Test php-redis
Create a new file test.php in the web root directory /var/www/ with the following content:
Copy code The code is as follows:
$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('Jay13','www.jb51.net');
echo 'Jay13:'.$redis->get('Jay13');
echo '';
echo 'Jay12:'.$redis->get('Jay12');
?>
The result is as shown below:

win11安装语言包错误0x800f0950什么原因?当我们在给windows11系统安装新语言包时,有时会遇到系统提示错误代码:0x800f0950,导致语言包安装流程无法继续进行下去。导致这个错误代码一般是什么原因,又要怎么解决呢?今天小编就来给大家说明一下win11安装语言包错误0x800f0950的具体解决步骤,有需要的用户们赶紧来看一下吧。win11电脑错误代码0x800f0950解决技巧1、首先按下快捷键“Win+R”打开运行,然后输入:Regedit打开注册表。2、在搜索框中输入“

GoogleDocs在学校和工作环境中变得很流行,因为它提供了文字处理器所期望的所有功能。使用Google文档,您可以创建文档、简历和项目提案,还可以与世界各地的其他用户同时工作。您可能会注意到GoogleDocs不包括MicrosoftWord附带的所有功能,但它提供了自定义文档的能力。使用正确的字体可以改变文档的外观并使其具有吸引力。GoogleDocs提供了大量字体,您可以根据自己的喜好从中选择任何人。如果您希望将自定义字体添加到Google文档,请继续阅读本文。在本文中

Notepad++主要由开发人员用于编辑源代码,由临时用户用于编辑文本。但是,如果您刚刚升级到Windows11,则在您的系统上下载和安装该应用程序可能具有挑战性。因此,我们将讨论在Windows11上下载和安装记事本++。此外,您可以轻松阅读我们关于修复Notepad++在Windows上没有响应的详细指南。记事本++可以在Windows11上运行吗?是的,记事本++可以在Windows11上有效工作,而不会出现兼容性问题。更具体地说,没有臃肿的选项或错误,只需在一个非常小的编辑器中即可。此外

Steam客户端无法识别您计算机上的任何游戏吗?当您从计算机上卸载Steam客户端时,会发生这种情况。但是,当您重新安装Steam应用程序时,它会自动识别已安装文件夹中的游戏。但是,别担心。不,您不必重新下载计算机上的所有游戏。有一些基本和一些高级解决方案可用。修复1–尝试在同一位置安装游戏这是解决这个问题的最简单方法。只需打开Steam应用程序并尝试在同一位置安装游戏即可。步骤1–在您的系统上打开Steam客户端。步骤2–直接进入“库”以查找您拥有的所有游戏。第3步–选择游戏。它将列在“未分类

<p><strong>HaloInfinite(Campaign)</strong>是一款第一人称射击视频游戏,于2021年11月推出,可供单人和多用户使用。该游戏是Halo系列的延续,适用于Windows、XboxOne和Xbox系列的用户X|S。最近,它还在PC版XboxGamePass上发布,以提高其可访问性。大量玩家报告在尝试使用WindowsPC上的<strong>Xbox应

我们深知MicrosoftWindows11是一个功能齐全且设计吸引人的操作系统。但是,用户一直要求Windows11Lite版本。尽管它提供了重大改进,但Windows11是一个资源匮乏的操作系统,它可能很快就会使旧机器混乱到无法顺利运行的地步。本文将解决您最常问的关于是否有Windows11Lite版本以及是否可以安全下载的问题。跟着!有Windows11Lite版本吗?我们正在谈论的Windows11Lite21H2版本是由Neelkalpa的T

<p><strong>邮件应用程序</strong>是Windows11内置的一个非常有用的电子邮件客户端。它允许您从一个位置管理所有邮件帐户。虽然Mail应用程序非常有用,但有时可能需要重置,有时也需要重新安装,原因有多种。在本文中,我们将通过一些简单的步骤说明如何从Windows11轻松卸载Mail应用程序,以及如何轻松地从MicrosoftStore将其取回。</p>&l

win11怎么安装无线网卡驱动?很多win11用户都在使用无线网卡作为自己的上网硬件,而无线网卡驱动是启动和趋势无线网卡的重要程序。很多小伙伴在使用无线网卡的过程中,却不清楚该如何安装和更新无线网卡驱动,导致驱动版本落后,影响网络质量,那么,我们该如何安装无线网卡驱动呢?下面就由小编为大家带来win11无线网卡驱动安装教程。win11无线网卡驱动安装教程1、首先,按【Win】键,或点击任务栏上的【开始图标】,然后点击已固定应用下的【设置】;2、打开的设置(Win+i)窗口,左侧点击【Window


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Mac version
God-level code editing software (SublimeText3)

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1
Easy-to-use and free code editor

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
