Per-Domain php.ini settings - start point

Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"

Top Level » CustomBuild » ./build php
Top Level » Apache Related Information » Php

Per-Domain php.ini settings - start pointLast Modified: Jul 3, 2017, 6:33 pm
With the many different types of php modes, this means the method of adding custom per-domain changes can vary greatly.
Check your custombuild options.conf to determine which php1_mode you're using, and find the related guide below.
  • mod_php

    mod_php is the default and the most commonly used.  You can use 3 different methods to change php settings:
    1. .htaccess in the public_html to add php_admin_flag / php_admin_value
    2. "Admin Level -> Custom Httpd Config", to add php_admin_flag / php_admin_value
    3. php [PATH] or [HOST] sections
  • php-fpm

    php-fpm is handy for multiple instances of php, allowing the User to change php version from within their User Level area.  php-fpm does not support .htaccess changes as php-fpm is it's own stand-alone php server, but you can use
    1. php-fpmXX.conf custom settings
    2. php [PATH] or [HOST] sections
    3. User controlled .user.ini
  • fastcgi

    The fastcgi mode is effective, but some find it somewhat rigid in it's flexibility (blend of suphp and php-fpm).  To edit per-domain settings,
    you have 2 options:
    1. Manually create the .ini file at


      and the call to fastcgi will read that in if it exists.  Note that it's a full replacement and not an 'addon' ini, so ensure you have *all* settings you need in that file, as the default php.ini isn't used here.  Take a look inside the User's httpd.conf to see which .sh script is called, and the variables passed.  Then check inside that .sh script for more info on how it works.
    2. php [PATH] or [HOST] sections
  • suphp

    suhp is older, end-of-life, but some still use it. Your options are:
    1. per-User suphp setting, although you could just the "SetEnv" to the |CUSTOM| token on a per-domain basis at the Custom Httpd Config
    2. php [PATH] or [HOST] sections

Note that some settings like disable_functions can only be set once in the main php.ini file, and cannot be overridden by other areas, but this varies per php-mode. php-modes like php-fpm/fastcgi are much more stand-alone php instances, so you can get away with these types of overrides, away from the main php.ini.
Related Helpfiles
I want per-domain or per-path settings for php
per-User php.ini settings in php-fpm
per-path php settings, controllable by the User

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST