Preferred method for setting vhost-specific php.ini defaults while allowing override

Discussion in 'Installation/Configuration' started by cbj4074, May 8, 2014.

  1. cbj4074

    cbj4074 Member

    I'm not sure if this is a new behavior or not, and it makes sense, but I noticed that when I enter custom php.ini configuration directives for a website, in the ISPConfig interface, the directives are written to the site's PHP-FPM pool configuration file with the php_admin_ prefix.

    For example, if I enter the following in the site's "Custom php.ini settings" field

    the following results in /etc/php5/fpm/pool.d/web1.conf:

    php_admin_flag[display_errors] = On
    Does this occur because the "admin" account created the website in question? Or is that irrelevant here?

    If so, what is the preferred method for specifying custom php.ini directives such that they are not prepended with php_admin_?

    I ask because I need to allow site-owners/end-users to override certain php.ini defaults at run-time (for example, via the error_reporting() function).

    Thanks for any help. ISPConfig with nginx-1.1.19 and PHP-FPM.
  2. cbj4074

    cbj4074 Member

    I hate to bump the thread, but this is an important issue.

    If nobody has a definitive answer, I'll open an issue on the Bug Tracker, which, again, I hate to do if this is not a "bug".

    Thanks for any insight.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    php directives that you add in the custom php.ini field in ispconfig are stored as php_admin_flag[] to ensure that they can not be overridden by a user. So what you decsribe is the intended behaviour of this function and not a bug. If users would be able to override the php.ini settings themself, theny they could extend their limits that the administrator has set for their site which should not be possible.
  4. cbj4074

    cbj4074 Member

    Thanks, Till. Your explanation as to why the client should not be able to override these values makes sense. I just wanted to be sure that the behavior is intentional.

    I simply set the default value in the main php.ini (for example, /etc/php5/conf.d/zzz-my-customzations.ini) and removed the desired default error-reporting level from the client's ISPConfig website.

    The end-result is that the client can override any setting that can be defined at run-time, unless I have explicitly set a value that I do not want to be overridden in the client's ISPConfig Website settings.

    This gets me to where I want to be. Thanks for clarifying, Till.

Share This Page