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.