Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server where php is running as an apache module.

Every user on the server is restricted to his own directory with open_basedir.

I have disabled the following functions:

disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,parse_ini_file,show_source

Now I'd like to forbid custom php config settings, such as:






How would you go about it?


share|improve this question
up vote 3 down vote accepted

You can use the php_admin_value and php_admin_flag directives to hard code the values into your apache config, this will prevent both .htaccess and ini_set from overriding the values you set.

You can read about these directives in the PHP documentation

share|improve this answer
Ah! Thanks SubOracle, I read that page but missed the "Any directive type set with php_admin_value can not be overridden by .htaccess or ini_set()". Do you reckon this will still be true even if there is "AllowOverride all" in my httpd.conf? Well I'll make a test myself asap and report back. – wlf Dec 31 '12 at 9:57
php_admin_value memory_limit 128M worked even with AllowOverride All – wlf Dec 31 '12 at 10:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.