Cluster mongo Db Not Connecting in php

<?php 
 require_once 'vendor/autoload.php';
 $con = new MongoDB\Client("mongodb://user_name:password@cluster0-shard-00-00.2twek.mongodb.net:27017,cluster0-shard-00-01.2twek.mongodb.net:27017,cluster0-shard-00-02.2twek.mongodb.net:27017/test?ssl=true&replicaSet=atlas-6wx29r-shard-0&authSource=admin&w=majority");
 $db = $con->selectDatabase('test');  
 $col = $db->selectCollection('user');
 $sql = $col->find();
 foreach($sql as $cols)
{
    var_dump($cols);
}
?> 

But it shows this error. Pls, help me to solve it.

Hi @singa_raj,

Welcome to the community :slight_smile:

I cannot see that you have posted any error unless I have missed it. Can you provide the following information:

  1. The full error message
  2. If you’ve been able to connect previously
  3. Driver version
  4. (Optional but could help with troubleshooting) - If you have attempted to connect from the same client using mongosh or MongoDB Compass (you’ll need to select Deployment Type: cloud and Client: shell or Client: compass for the corresponding connection guides).

Regards,
Jason