redis与apache服务器兼容吗?我正在尝试从存储在apache服务器web目录中的php脚本运行redis。
<?php
//Connecting to Redis server on localhost
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
echo "Connection to server sucessfully";
//check whether server is running or not
echo "Server is running: ".$redis->ping();
?>当我尝试加载我的网页时,我得到一个505编程错误。我的apache设置重要吗?我想我的phpredis扩展可能没有正确设置。我可以从树莓派终端连接到redis。如果这是我的问题,有没有人有好的教程来给php添加一个redis扩展?
发布于 2018-02-11 00:53:02
发布于 2018-02-11 01:40:08
好吧,有很多可能是初学者的错误,但我已经弄清楚了。我没有,现在仍然没有启动脚本,所以我必须使用这个命令从raspberry pi终端启动Redis。我假设每次重启后都需要这样做: pi@raspberrypi:~ $ redis-server。Redis官方页面上的快速入门指南给了我解决方案https://redis.io/topics/quickstart。
https://stackoverflow.com/questions/48722437
复制相似问题