I'm new in neo4j and i'm trying to use neoclient following the github instructions. I have installed neoclient with composer and neo4j 2.2.5. Now i'm trying to use it with php. When i try to set up the connection with following:
<?php
require_once 'vendor/autoload.php';
use Neoxygen\NeoClient\ClientBuilder;
$client = ClientBuilder::create()
->addConnection('default', 'http', 'localhost', 7474)
->build();
$query = 'CREATE (user:User {name:"Kenneth"}) RETURN user';
$result = $client->sendCypherQuery($query)->getResult();
?>
I get the following error:
Fatal error: Uncaught exception 'Neoxygen\NeoClient\Exception\HttpException' with message 'Error on Connection "default" with message "Client error response [url] http://localhost:7474/db/data/transaction/commit [status code] 401 [reason phrase] Unauthorized"' in C:\wamp\www\fantapappa\vendor\neoxygen\neoclient\src\EventListener\HttpRequestEventSubscriber.php on line 65
and
Neoxygen\NeoClient\Exception\HttpException: Error on Connection "default" with message "Client error response [url] http://localhost:7474/db/data/transaction/commit [status code] 401 [reason phrase] Unauthorized" in C:\wamp\www\fantapappa\vendor\neoxygen\neoclient\src\EventListener\HttpRequestEventSubscriber.php on line 65
can someone help me? where i'm wrong?