我正在尝试将neo4j连接到php。我正在使用Windows并使用XAMPP服务器。
我发现了一个与我类似的问题。 Neo4 giving error:" Uncaught exception 'Everyman\Neo4j\Exception' with message 'Unable to retrieve server info [500]:"。
根据上述链接中给出的解决方案。我收到以下错误。
Fatal error: Undefined constant 'Everyman\Neo4j\Transport\Curl' in C:\xampp\htdocs\con1.php on line 4
我试过运行php neo4jphp.phar thrugh命令行,我收到以下错误
Fatal error: Uncaught exception 'Everyman\Neo4j\Exception' with message 'Unable to retrieve server info [500]:
Headers: Array
(
)
Body: Array
(
[error] => Could not resolve host: 7474 [6]
)
' in phar://C:/xampp/php/neo4jphp.phar/lib/Everyman/Neo4j/Command.php:116
Stack trace:
#0 phar://C:/xampp/php/neo4jphp.phar/lib/Everyman/Neo4j/Command/GetServerInfo.php(52): Everyman\Neo4j\Command->throwExce
ption('Unable to retri...', 500, Array, Array)
#1 phar://C:/xampp/php/neo4jphp.phar/lib/Everyman/Neo4j/Command.php(69): Everyman\Neo4j\Command\GetServerInfo->handleRes
ult(500, Array, Array)
#2 phar://C:/xampp/php/neo4jphp.phar/lib/Everyman/Neo4j/Client.php(587): Everyman\Neo4j\Command->execute()
#3 phar://C:/xampp/php/neo4jphp.phar/lib/Everyman/Neo4j/Client.php(360): Everyman\Neo4j\Client->runCommand(Object(Everym
an\Neo4j\Command\GetServerInfo))
#4 C:\xampp\php\neo4jphp.phar(45): Everyman\Neo4j\Client->getServerInfo()
#5 {main}
thrown in phar://C:/xampp/php/neo4jphp.phar/lib/Everyman/Neo4j/Command.php on line 116
此外,当我运行以下代码时
<?php
use Everyman\Neo4j\Client,
Everyman\Neo4j\Transport;
require('neo4jphp.phar');
$client = new Client(new Transport('localhost', 7474));
print_r($client->getServerInfo());
?>
我收到以下错误
Fatal error: Uncaught exception 'Everyman\Neo4j\Exception' with message 'Unable to retrieve server info [500]:
Headers: Array ( ) Body: Array ( [error] => Failed connect to localhost:7474; No error [7] )
' in phar://C:/xampp/htdocs/neo4jphp.phar/lib/Everyman/Neo4j/Command.php:116 Stack trace:
#0 phar://C:/xampp/htdocs/neo4jphp.phar/lib/Everyman/Neo4j/Command/GetServerInfo.php(52): Everyman\Neo4j\Command->throwException('Unable to retri...', 500, Array, Array)
#1 phar://C:/xampp/htdocs/neo4jphp.phar/lib/Everyman/Neo4j/Command.php(69): Everyman\Neo4j\Command\GetServerInfo->handleResult(500, Array, Array)
#2 phar://C:/xampp/htdocs/neo4jphp.phar/lib/Everyman/Neo4j/Client.php(587): Everyman\Neo4j\Command->execute()
#3 phar://C:/xampp/htdocs/neo4jphp.phar/lib/Everyman/Neo4j/Client.php(360): Everyman\Neo4j\Client->runCommand(Object(Everyman\Neo4j\Command\GetServerInfo))
#4 C:\xampp\htdocs\con1.php(9): Everyman\Neo4j\Client->getServerInfo()
#5 {main} thrown in phar://C:/xampp/htdocs/neo4jphp.phar/lib/Everyman/Neo4j/Command.php on line 116
错误可能是什么?