System or Service Template defaults for PHP

Discussion in 'Plesk Automation Suggestions and Feedback' started by SteveITS, Apr 10, 2015.

  1. SteveITS

    SteveITS Tera Poster

    Messages:
    277
    Is there a way to set default PHP settings so they apply by default to all websites' custom php.ini file, or even server-wide or system-wide? For example, the timezone? I am using custom builds of PHP 5.5 and 5.6, per the PPA docs, but I found that, contrary to some Plesk (not PPA) documentation, /etc/php.ini is not used. It looks like a set of PHP settings are generated into a php.ini for the vhost, and I can set "Additional Directives" for each website but would prefer to set a system default. For instance, on recent PHP versions not having a timezone set generates a warning in the logs on every PHP execution. I'd also like to enable opcache since we're using FastCGI. So from where does PHP generate the vhost's php.ini?


    As an aside, adding an "Additional Directives" entry with this unquoted generated an error and no directives were saved:
    date.timezone=America/Chicago
    Instead, I had to quote it:
    date.timezone="America/Chicago"
     
  2. Starl1ght

    Starl1ght Just a cat

    Messages:
    81
    Should be fixed in MU#10, afair
     
  3. SteveITS

    SteveITS Tera Poster

    Messages:
    277
    Hi Denis, I think you mean the timezone entry bug was fixed...? I recall a note about that in the update readme. However I am more interested in having a "default php.ini" so that I don't have to add certain settings in for every vhost added to the server in the future. Does that ability exist?
     
  4. SteveITS

    SteveITS Tera Poster

    Messages:
    277
    It's amazing the things you see looking at something the nth time. There's a PHP option for "Scan this dir for additional .ini files" which is /etc/php.d or on custom compilation, anything you want (/usr/local/php567-cgi/php.d or /etc/php56.d/). So even if PPA doesn't have default options, they can be set for the server. The system default (PHP 5.3) version looks in /etc/php.d/.
     
  5. SteveITS

    SteveITS Tera Poster

    Messages:
    277
    I'm late getting back to my own thread but I was looking at this again today for a bit. "Scan this dir for additional .ini files" is parsed after the site's file, /var/www/vhosts/system/example.com/etc/php.ini. So basically anything entered into the "additional" file overrides anything entered by the user. So that's the opposite of a default setting...it is an enforced mandatory setting.
     
  6. SteveITS

    SteveITS Tera Poster

    Messages:
    277

Share This Page