我刚刚在 Windows 中安装了 neo4j 服务器并尝试连接 php。我运行了 xampp,使用 composer 安装了 neo4jphp,然后尝试使用以下脚本检查连接:
<?php
require('vendor/autoload.php');
$client = new Everyman\Neo4j\Client('localhost', 7474);
print_r($client->getServerInfo());
?>
现在,不是显示服务器状态,而是发生了一个致命错误,如下所示:
致命错误:未捕获的异常“Everyman\Neo4j\Exception”,消息“无法检索服务器信息 [401]:标头:数组([日期] => 2015 年 5 月 27 日星期三 10:54:01 GMT [内容类型] = > application/json; charset=UTF-8 [WWW-Authenticate] => None [Content-Length] => 144 [Server] => Jetty(9.2.z-SNAPSHOT) ) 正文: Array ([errors] => Array ( [0] => 数组 ( [message] => 未提供授权标头。[code] => Neo.ClientError.Security.AuthorizationFailed ) ) ' 在 C:\xampp\htdocs\neo4j\vendor\everyman\neo4jphp\ lib\Everyman\Neo4j\Command.php:116 堆栈跟踪:#0 C:\xampp\htdocs\neo4j\vendor\everyman\neo4jphp\lib\Everyman\Neo4j\Command\GetServerInfo.php(53): Everyman\Neo4j\ Command->throwException('Unable to retri...', 401, Array, Array) #1 C:\xampp\htdocs\neo4j\vendor\everyman\neo4jphp\lib\Everyman\Neo4j\Command.php(69): Everyman\Neo4j\Command\GetServerInfo->handleResult(401, Array, Array) #2 C:\xa in C:\xampp\htdocs\neo4j\vendor\everyman\neo4jphp\lib\Everyman\Neo4j\Command.php 在第 116 行
如何解决这个问题?任何帮助将不胜感激。提前致谢。