Cannot connect from a PHP script: Desktop or Docker

Using the 'recommended' (from Using Neo4j from PHP - Developer Guides) graphaware/neo4j-php-client (which btw, appears to be no longer supported)

Tried 2 ways of doing this (i.e. servers)
1/ run desktop database
2/ run a docker instance using neo4j:latest (even tried neo4j:enterprise on the off chance)

PHP code:

$client = ClientBuilder::create()
            ->addConnection('default', 'bolt://neo4j:password@localhost:7687')
            ->build();

In both cases, I try to connect and get:

Handshake Exception. Unable to negotiate a version to use. Proposed versions were [1,0,0,0]

error

  • neo4j version: 4.0.6
  • desktop: 1.2.9

My preference is to use Docker as that fits the rest of my team's tool chain. Here is docker-compose config for reference:

neo4j:
    image: neo4j:latest
    restart: unless-stopped
    ports:
      # HTTP
      - "${LOCAL_LISTEN_ADDR}7474:7474"
      # BOLT
      - "${LOCAL_LISTEN_ADDR}7687:7687"
    volumes:
      - ${DEVILBOX_PATH}/neo4j/conf:/conf
      - ${DEVILBOX_PATH}/neo4j/data:/data
      - ${DEVILBOX_PATH}/neo4j/import:/import
      - ${DEVILBOX_PATH}/neo4j/logs:/logs
      - ${DEVILBOX_PATH}/neo4j/plugins:/plugins
    environment:
      # Raise memory limits
      - NEO4J_dbms_memory_pagecache_size=1G
      - NEO4J_dbms.memory.heap.initial_size=1G
      - NEO4J_dbms_memory_heap_max__size=1G

The docker container does fire up and I can browse to it with Chrome. Info gleaned for docker install from How-To: Run Neo4j in Docker - Developer Guides and some blog posts.

So, it appears that whatever I do for a backend, I cannot connect to Neo4j. Unless I can get local dev working, then I'm going to have to look at alternative platforms for our graph db solution. Any ideas greatly appreciated.

Hi @chippyash,

I had the same issue. It seems that the community PHP drivers are not compatible with Neo4j v.4.0+.

A workaround is to use an older version of neo4j; I just tested that version 3.4.14 works with the drivers. Probably a later version, such as 3.5.15 might work too, but I have not tested it yet.

@paris.tsantarliotis. that is a shame. I guess neo4j is a dead end for PHP devs then because as I said, the php library is no longer supported. Oh well, off to Neptune and Gremlin or Sparkle we must go. :frowning:

Either that or update your stack to include a language with official support.
There are many to choose from.

@webtic Not too helpful. Fancy chipping in for the retraining costs of 20 developers? :disappointed:

Moving forward, regardless the direction, involves training and learning.
If thats too costly you could also or stick with the current 3.5 series.
Or even start contributing to the community drivers ;-)