please change that to if ( ! extension_loaded('mongodb')) and put the skip right on top. Then don't use an else for the initialization/setup code