Quite often you’re on a shared host and the default php.ini settings that your provider has left you with are less than ideal. So you just use ini_set and ini_get to dynamically introduce your own values right?
Well, that’ll work if the particular php.ini setting you’re after is changeable:
|PHP_INI_USER||1||Entry can be set in user scripts|
|PHP_INI_PERDIR||2||Entry can be set in php.ini, .htaccess or httpd.conf|
|PHP_INI_SYSTEM||4||Entry can be set in php.ini or httpd.conf|
|PHP_INI_ALL||7||Entry can be set anywhere|
Certain things, like zlib.output_compression cannot be altered in userland, nor can open_basedir, so you have to look for another approach to solve your problem. As the above chart says, shared hosting subscribers still have one last chance, that is to attempt to modify the php.ini value with an .htaccess file, if of course the webserver is configured to parse .htaccess files.
But in the case of open_basedir this is not possible as the setting has a ‘changeable‘ value of PHP_INI_SYSTEM, ie, it can only be changed in the php.ini file or in apache’s httpd.conf.
This is where things start to get interesting 😉