[Solved] PHP connect to MongoDB error: Server does not support sessions

Solution steps:

Find the mongodb configuration file and make the following adjustments

replication:
   oplogSizeMB: <int>
   replSetName: <string>
   enableMajorityReadConcern: <boolean>

After restarting the mongodb service, enter Mongo for execution

rs.initiate()
    Done!

Reference:
https://stackoverflow.com/questions/50255195/how-to-configure-a-mongodb-cluster-which-supports-sessions

Similar Posts: