Turns off error reporting if configurated

Turns on PHP error reporting and enables display_errors if configurated
to do so.
Better error message if mysql connection fails

previously there was no error message when connection failed, this has
been added