I found this error this morning after upgrading my PHP MongoDB extension from 1.5.x to 1.6.x.
Fatal error: exception 'Error' with message 'Invalid class method "createIndex"' in .... .php
This was cause by the function ensureIndex() being deprecated/remove in favor of createIndex()
Took me about 30 min to figure out (a lot longer) because there was no result on Google about this, so I thought this blog article hopefully helps somebody in future.