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'm running a setup with PHP 5.3.8 and use php-fpm with it's chroot functionality to separate multiple customers. So each customer has it's own chrooted PHP-environment, which is quite fine.

I now want to disallow that a customer can change the memory_limit of his PHP-instance by using ini_set. On the other hand I don't want to disable ini_set completely. So I'm searching for a possibility to disable the possibility to set specific PHP configuration options (like memory_limit) via ini_set.

Does somebody know how to achieve that?

share|improve this question
Look into suhosin it is well suited to hardening PHP for hosting environments, including preventing alteration of the memory_limit – cyberx86 Nov 27 '11 at 4:02

You can't, without patching the PHP source code.

share|improve this answer

As cyberx86 noted in his comment, it's at least possible with suhosin to disallow changes to memory_limit during runtime. The configuration option for that in suhoshin is called suhosin.memory_limit.

share|improve this answer

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.