Install mongo-orchestration and start a sharded cluster:
mongo-orchestration -b 127.0.0.1 -p 8889 --no-fork start
curl -XPUT http://localhost:8889/v1/sharded_clusters/myCluster --data @configurations/sharded_clusters/clean.json
Then, run the included PHP script:
$ php invalid-cursor-listCollections.php
PHP Fatal error: Uncaught exception 'MongoCursorException' with message 'localhost:27017: the command cursor did not return a correctly structured response' in invalid-cursor-listCollections.php:7
Stack trace:
#0 invalid-cursor-listCollections.php(7): MongoDB->listCollections()
#1 {main}
thrown in invalid-cursor-listCollections.php on line 7