当前位置:Gxlcms > PHP教程 > 安装redis失败

安装redis失败

时间:2021-07-01 10:21:17 帮助过:8人阅读

php下载 dll文件

http://download.csdn.net/download/bluesky321/5355093

php_redis.dll 扩展 For PHP5.4.x

首先把php_redis.dll 和 php_igbinary.dll 放入PHP的ext文件夹,然后在php.ini配置文件里添加如下代码:

extension=php_igbinary.dll

extension=php_redis.dll

重启web服务器

代码如下

$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('test','hello redis');
echo $redis->get('test');

?>
提示Fatal error: Class 'Redis' not found in D:xampphtdocsindex.php on line 2

回复内容:

php下载 dll文件

http://download.csdn.net/download/bluesky321/5355093

php_redis.dll 扩展 For PHP5.4.x

首先把php_redis.dll 和 php_igbinary.dll 放入PHP的ext文件夹,然后在php.ini配置文件里添加如下代码:

extension=php_igbinary.dll

extension=php_redis.dll

重启web服务器

代码如下

$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('test','hello redis');
echo $redis->get('test');

?>
提示Fatal error: Class 'Redis' not found in D:xampphtdocsindex.php on line 2

有三种方法可以检查你的PHP扩展有没有打开:
1.phpinfo();
2.命令行cd到php执行文件目录,输入:php -m
3.用以下代码:

人气教程排行