Hey!!! Finally it works!!
The problem was simply that I didn't had configured the email settings, so that mahara can send emails.
It seems like in the code there is something that gets the script in an infinite loop when it tries to do something with the email(i don't know what for it tries to use the email, but anyway) when you try to login.