Wednesday, June 21, 2006

How to overwrite a php.ini setup

Often ISP's don't let people change a php.ini setup. Nevertheless, you can programatically change some of the setup.

This can be really useful, for instance to disable the display of some useless warning messages:

ini_set("display_errors","Off");
(... do some stuff here ...)
ini_restore('display_errors');

As you could see here, the error messages were then re-enabled.