在使用Apache时,Php脚本停留在“new Mongo()”

I wrote a little php login script. It searches in a mongoDb-collection for the provided credentials. If i run it from console with

php login.php

it runs flawless. However, if i try to log in from the html-interface it seems to be stuck at

$m = new Mongo(...);

directive, and doesn't continue with the other lines of code. I'm running over an apache server on my laptop, just to try what i'm doing.

2 things you will need to check are:

1: Is mongo enabled in your php.ini? 2: If you using a recent version of php then try changing it from

$m = new Mongo();

to

$m = new MongoClient();