因此,我刚刚开始学习Redis,并尝试使用以下链接安装它:- https://github.com/nrk/predis
我通过composer安装了它,然后运行:-
require 'autoload.php';
$client = new Predis\Client(array('host' => "127.0.0.1", "port" => 6379, array("prefix" => "php:")));
$client->set("string:k", "something");但是,这会产生错误:-
Fatal error: Uncaught Error: Class 'Predis\Configuration\Options' not found in /Library/WebServer/Documents/redis/2/src/Client.php on line 74
Error: Class 'Predis\Configuration\Options' not found in /Library/WebServer/Documents/redis/2/src/Client.php on line 74这里怎么了?
发布于 2017-09-11 12:09:44
你必须像这样注册Predis Autoloader
require __DIR__ . '/vendor/autoload.php'; //autoload vendor see https://getcomposer.org/doc/01-basic-usage.md#autoloading
$client = new Predis\Client(array('host' => "127.0.0.1", "port" => 6379, array("prefix" => "php:")));
$client->set("string:k", "something");https://stackoverflow.com/questions/46155341
复制相似问题