why do you use the mongo shell syntax if you query from the php client?
anyway I don't think you can hope to find and print 10mio of records in a resonable workload time without split your queries, also catch the Calimero suggestion and create your own pagination algorithm using skip limit.
$cursor = $db->collection->find($criteria, $projection)->sort($order)->skip($skip)->limit($limit);
give also a look at this link
or you could simply implement an external class that does it for you, check here and find MongoDB Pagination