[php] (change:minor) Improved error messages. Also redirect DB error message also to the server log.