I am trying to set up an Amazon EB instance to work with DocumentDB. When I try to connect with amazon linux terminal, the connection just work fine. But when I try to connect with PHP it returns an error shown below
"No suitable servers found (serverSelectionTryOnceset): [socket timeout calling ismaster on 'docdb-XXXX-XX-XX-XX-XX-XX.cluster-cXXXXXXXXXX.eu-west-1.docdb.amazonaws.com:27017']"
I troubleshooted with terminal and got "succeeded!" which indicate successful connection again.
nc -zv docdb-docdb-XXXX-XX-XX-XX-XX-XX.cluster-cXXXXXXXXXX.eu-west-1.docdb.amazonaws.com 27017
Anyone has any idea what can be wrong?
Here is my code to connect to DocumentDB
$conn = new MongoClient("mongodb://username:password@docdb-docdb-XXXX-XX-XX-XX-XX-XX.cluster-cXXXXXXXXXX.eu-west-1.docdb.amazonaws.com:27017/?ssl_ca_certs=rds-combined-ca-bundle.pem&replicaSet=rs0");