Enabling PHP error reporting on Dhiraagu hosting

Here's a quick tip for anyone stumped by the issue.

I have not dealt with the web hosting services from Dhiraagu for a long time but had a brief encounter earlier this week when I was attempting to setup the custom CMS we use at Semicolon for a client project. It turns out Dhiraagu has error reporting disabled for their PHP setup as well as disabled the phpinfo() function, which by themselves really are decent security measures. But as a developer, error reporting is essential when setting up a new application or testing out code and debugging.

You can get back error reporting on Dhiraagu hosting services by overriding their error reporting setting through a .htaccess or by adding a PHP statement at the start of the PHP files.

.htaccess:
php_value display_errors on
php_value display_startup_errors on


PHP:
ini_set('display_errors',1);
error_reporting(E_ALL); // Or whatever level of error reporting you would like


Unfortunately, short of asking Dhiraagu, there is no way (atleast, that I am aware of) to activate the phpinfo function if it has been disabled by adding it to the "disable_functions" list in php.ini. However, it is possible to cull all (if not most) the data available via the phpinfo() function using other functions available within PHP.