Override 'disable_functions' in php.ini with ini_set()

Can I use ini_set to override the php.ini setting ‘disable_functions’ set in a shared hosting environment using ini_set?
Something like this (not tested, don’t have access to a server now):


<?php
// returns 'system,readfile,passthru,exec,shell_exec,popen,telnet,friends'
$settings = ini_get('disable_functions');
// Make sure that 'system' is available. Perhaps with regexp...
$newsetting = 'readfile,passthru,exec,shell_exec,popen,telnet,friends';
// Set the new settings
ini_set('disable_functions', $newsettings);
?>

or are only some settings ‘overridable’?

Hi,
Take a look at the table of configurable options here : http://www.php.net/manual/en/function.ini-set.php

Constant Value Meaning
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

Ah darn :stuck_out_tongue: I suspected something like that. Oh well, then I will have to find another way. I wanted to use the ‘cal’ linux command, but I will write it myself in PHP then…