gpt4 book ai didi

ubuntu - fatal error : Class 'Redis' not found

转载 作者:IT王子 更新时间:2023-10-29 05:55:28 39 4
gpt4 key购买 nike

我已经在我的 ubuntu 14 服务器上安装了带有 phpredis 扩展名的 Redis。我正在使用 Nginx 服务器。我有 php 测试脚本

$redis=new Redis() or die("Cannot load Redis module.");
$redis->connect('localhost');
$redis->set('random', rand(5000,6000));
echo $redis->get('random');

它在命令行中运行良好,但在网络浏览器中运行不正常。

Nginx 错误日志:

[info] 31102#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:82
[error] 31108#0: *21 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'Redis' not found in...

我什至在 phpinfo() 中也看不到它

全部用apt-get install安装

所有其他模块(mysql、imagemagick...)工作正常

我在谷歌上花了几个小时,但没有找到任何有用的东西

最佳答案

你已经安装了redis但没有安装php-redis。你可以简单地运行下面的命令来安装 php-redis

sudo apt-get install php-redis

关于ubuntu - fatal error : Class 'Redis' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25230399/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com