我有一个使用Redis的本地Laravel项目,它在本地环境中运行良好。但随后我将项目移至共享主机。我在那里安装了redis,启动了redis服务器。我确认redis服务器已启动并正在运行。但每当我试图访问页面时,我都会收到以下错误:
(1/1) ConnectionException
Connection timed out [tcp://127.0.0.1:6379]
in AbstractConnection.php (line 155)
at AbstractConnection->onConnectionError('Connection timed out', 110)
in StreamConnection.php (line 128)
at StreamConnection->createStreamSocket(object(Parameters), 'tcp://127.0.0.1:6379', 4)
in StreamConnection.php (line 178)
at StreamConnection->tcpStreamInitializer(object(Parameters))
in StreamConnection.php (line 100)
at StreamConnection->createResource()
in AbstractConnection.php (line 81)
at AbstractConnection->connect()
in StreamConnection.php (line 258)
at StreamConnection->connect()
in AbstractConnection.php (line 180)
at AbstractConnection->getResource()
in StreamConnection.php (line 288)
at StreamConnection->write('*4 $9 ZREVRANGE $15 popular_threads $1 0 $1 5 ')
in StreamConnection.php (line 394)
at StreamConnection->writeRequest(object(ZSetReverseRange))
in AbstractConnection.php (line 110)
at AbstractConnection->executeCommand(object(ZSetReverseRange))
in Client.php (line 331)
at Client->executeCommand(object(ZSetReverseRange))
in Client.php (line 314)
at Client->__call('zrevrange', array('popular_threads', 0, 5))
in Connection.php (line 72)
它在我的本地电脑上工作正常。它与共享主机有什么关系吗?我该如何解决或解决这个问题?
TIA,Yeasir