-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Can't connect to a neo4j aura instance with pdo_bolt #4
Comments
Hi. When you want to connect to aura you require SSL. You can enable it with $options in PDO constructor. You can read about it in readme https://github.com/stefanak-michal/pdo-bolt#pdo-constructor-available-options So your line will look like this: $pdo = new \pdo_bolt\PDO('bolt:host=1c27354c.databases.neo4j.io;port=7687;appname=pdo-bolt', 'neo4j', 'password', ['ssl' => ['verify_peer' => true]]); |
Hello ! Thanks for your reply. I still have an error to connect but, now, it runs StreamSocket->connect(). [app/src/Bolt/Bolt.php:52] Bolt\connection\StreamSocket->connect() I checked my php config (PHP 8.0). Sockets and open ssl are enabled as well as Maybe i've make a mistake on the format ? Thanks for your help. Best. Christophe |
Do you still get timeout error? More info will be nice. You don't need ext-sockets if you use SSL, because StreamSocket use native php stream functions. Only openssl is required. Your list of available transports is okay, it should use TLS (i think). |
Hello !
I'm trying to work with pdo_bolt connection with an neo4j aura instance.
Here's my code :
$pdo = new \pdo_bolt\PDO('bolt:host=1c27354c.databases.neo4j.io;port=7687;appname=pdo-bolt', 'neo4j', '');
$stmt = $pdo->prepare('MATCH (m:Movie)
RETURN m.title AS title
ORDER BY m.title
ASC LIMIT $n');
$stmt->bindValue('n', 123, \PDO::PARAM_INT);
$stmt->execute();
$stmt->setFetchMode(\PDO::FETCH_ASSOC);
foreach ($stmt AS $row) {
print_r($row);
}
Connection is refused, if have an error from
[app/src/Bolt/Bolt.php:52] Bolt\connection\Socket->connect()
[app/src/pdo_bolt/drivers/bolt/Driver.php:107] Bolt\Bolt->build()
[app/src/pdo_bolt/PDO.php:68] pdo_bolt\drivers\bolt\Driver->__construct()
[app/controllers/MainController.php:16] pdo_bolt\PDO->__construct()
[lib/base.php:1955] MainController->render()
Thanks for your help.
Best.
C
The text was updated successfully, but these errors were encountered: