I am using graphaware to connect to a neo4j graph database. I keep getting an error saying Fatal error: Uncaught Error even though I'm using the library in composer.json. Here is the code for the autoload.php:
<?php
/*
* This file is part of the GraphAware Neo4j PHP OGM package.
*
* (c) GraphAware Ltd <info@graphaware.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
error_reporting(E_ALL | E_STRICT);
$basedir = __DIR__.'/../';
//$basedir = __DIR__.'C:/xampp/htdocs/';
$proxyDir = $basedir.DIRECTORY_SEPARATOR.'_var';
putenv("basedir=$basedir");
putenv("proxydir=$proxyDir");
$loader = require_once __DIR__.'/../vendor/autoload.php';
Here us the code for the configuration php file named configNeo4j.php:
<?php
// Connection to the database
require_once __DIR__.'/vendor/autoload.php';
use GraphAwareNeo4jClientClient;
use GraphAwareNeo4jClientClientBuilder;
$client = new Client ();
$client = ClientBuilder::create ()
->addConnection ( 'default', 'http://neo4j:neo4jj@127.0.0.1:7474' )
-> addConnection('bolt', 'bolt://neo4j:neo4jj@127.0.0.1:7687')
->build ();
$query = "MATCH (X) RETURN X";
$result = $client->run ( $query );
?>
Here is an image of the file structure:
Now when I run the webpage on a web browser which I am doing using xampps apache server I get this error message:
Fatal error: Uncaught Error: Class 'GraphAwareNeo4jClientClient' not found in C:xampphtdocsconfigNeo4j.php:11 Stack trace: #0 {main} thrown in C:xampphtdocsconfigNeo4j.php on line 11
This might also help:
This is strange because I am using the library in eclipse and I have also installed the composer in the php.exe file in xampp. If anyone has any solution to this problem it would be great if you could let me know how this problem can be fixed.Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…