如何在XAMPP窗口上安装Predis? [英] How do I install Predis on XAMPP windows?

查看:106
本文介绍了如何在XAMPP窗口上安装Predis?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Pearhub在XAMPP Windows机器上安装了Predis(pear安装pearhub/predis).它已安装,没有任何错误消息. 但是,当我执行以下操作

I installed Predis on XAMPP windows machine using pearhub (pear install pearhub/predis). It installed without any error messages. But when I do the following

<?php
require "Predis.php";
$redis = new Predis/Client();
$redis->set('library', 'predis');
$value = $redis->get('library');
?>

它说未找到Predis类.有任何想法如何在Windows上正确安装吗?

It says Predis class not found. Any ideas how to properly install this on windows?

推荐答案

您需要先安装Redis,然后Predis才能运行. Predis只是Redis的界面.

You need to install Redis first, and then Predis will work. Predis is only an interface for Redis.

由于您在Windows上,因此可以在以下可执行文件中找到信息: https://github.com/dmajkic/redis/downloads

Because you are on windows, you can find information in the executable here: https://github.com/dmajkic/redis/downloads

此外,我在您的代码中注意到,您有以下内容:

Also, I noticed in your code, you have this:

$redis = new Predis/Client();

应该是这样:

$redis = new Predis_Client();

这篇关于如何在XAMPP窗口上安装Predis?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆