Fixed bug in enabling php error reporting
Merged bugfixes from master