O'Reilly logo

Neo4j Cookbook by Ankur Goel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Accessing Neo4j from PHP

PHP is a one of the most popular languages when it comes to web development and it would make this chapter incomplete if we don't mention it.

In this recipe, we will learn how to access the Neo4j graph database using PHP.

Getting ready

Neo4jPHP is the most popular client when its comes to accessing the Neo4j graph database server using PHP.

You can find more information on this at https://github.com/jadell/neo4jphp.

The following steps will get you started with Neo4jPHP:

  1. Neo4jPHP can be installed by typing the following on the command line:
    echo '{"require":{"everyman/neo4jphp":"dev-master"}}' > composer.json && composer install
    
  2. In the PHP script, include the library, which has been installed, using the following command:
    require("vendor/autoload.php") ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required