Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello, I’ve difficulties with connection to MongoDB cluster on DigitalOcean by PHP. As we know, we have to use SSL, but I don’t know how. My code is as follows:
<?php
require_once __DIR__ . "/vendor/autoload.php";
$db = new MongoDB\Client('mongodb://[myapp].mongo.ondigitalocean.com', array(
'username' => 'doadmin',
'password' => '[password]',
'db' => '[database]',
'authSource' => 'admin',
'replicaSet' => '[replica]',
'tls' => 'true',
'tlsCAFile' => '/usr/share/ca-certificates/app/ca-certificate.pem'
));
$db = $conn->[database];
$collection = $db->[collection];
?>
I am getting an error: ‘Uncaught MongoDB\Driver\Exception\ConnectionTimeoutException: No suitable servers found’.
Do you know how to connect properly in this case? Thank you in advance.
personal
7c31733a76c942f69d6186090a3787
antoine
Jamal
DriftingNavyFish
4a14ba3a148542cab1814465d54cbf
Mattia
SleepingAquamarineMantaRay
AI-LastWish
Marcos Lemos