Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I need help working with Neo4j database in php #84

Open
nkem56 opened this issue May 18, 2021 · 1 comment
Open

I need help working with Neo4j database in php #84

nkem56 opened this issue May 18, 2021 · 1 comment

Comments

@nkem56
Copy link

nkem56 commented May 18, 2021

Good day Everyone,
Am trying to work on neo4j graph database using php. I saw your amazing projects on github

https://github.com/neoxygen/neo4j-neoclient

Please I have install xampp and my php is running locally.
I have also installed neo4j graph database and its running locally too.
I have also install the projects via composer as per "composer require neoxygen/neoclient"

when I try to connect via your sample code below and print the version. it seems its not connecting. it throws error

Fatal error: Uncaught Neoxygen\NeoClient\Exception\HttpException: Error on Connection "default" with message "Client error: GET http://localhost:7474/db/data resulted in a 401 Unauthorized response: { "errors" : [ { "code" : "Neo.ClientError.Security.Unauthorized", "message" : "No authentication header su (truncated...) " in C:\xampp\htdocs\neo_oxygen\src\EventListener\HttpRequestEventSubscriber.php:74 Stack trace: #0 C:\xampp\htdocs\neo_oxygen\vendor\symfony\event-dispatcher\EventDispatcher.php(184): Neoxygen\NeoClient\EventListener\HttpRequestEventSubscriber->onHttpException(Object(Neoxygen\NeoClient\Event\HttpExceptionEvent), 'neoclient.http_...', Object(Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher)) #1 C:\xampp\htdocs\neo_oxygen\vendor\symfony\event-dispatcher\EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'neoclient.http_...', Object(Neoxygen\NeoClient\Event\HttpExceptionEvent)) #2 C:\xampp\htdocs\neo_oxygen\src\HttpClient\GuzzleHttpCl in C:\xampp\htdocs\neo_oxygen\src\EventListener\HttpRequestEventSubscriber.php on line 74

below is your connection Code


<?php

require_once 'vendor/autoload.php';

use Neoxygen\NeoClient\ClientBuilder;

 $client = ClientBuilder::create()
    ->addConnection('default','http','localhost',7474)
    ->build();



$root = $client->getRoot();

//print_r($root);

$version = $client->getNeo4jVersion();
print_r($version);

very important,
My neo4j local database server has username: neo4j and password: neo65gbcAB

All I want to implement is how to
1.)Connect to my neo4j local database server
2.) create database eg Test_db via php
3.) insert, select, update and delete data from graph database using php. please can you also help me with that

Thanks

@Mulkave
Copy link
Member

Mulkave commented Sep 23, 2021

The new and supported PHP driver is https://github.com/neo4j-php/neo4j-php-client please go there and install it in your project to enjoy the latest Neo4j versions support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants