How do I include a php.ini file in another php.ini file?

后端 未结 7 1336
温柔的废话
温柔的废话 2020-12-01 13:59

How do I include a php.ini file in another php.ini file?

7条回答
  •  借酒劲吻你
    2020-12-01 14:15

    Actually YOU CAN. I just tested it on Debian 9 with PHP-FPM. From some .ini/.conf file, use this syntax:

    include=/path/to/special-php.ini
    

    or even

    include=/path/to/special-dir-full-of-conf-files/*.conf 
    

    as it is used in

    /etc/php/7.0/fpm/php-fpm.conf
    include=/etc/php/7.0/fpm/pool.d/*.conf
    

    By the way, this will be most useful if you split your settings by topic, and or if you want a set for dev and another one for production. Then you could do it the Debian/Apache style like

    /etc/php/conf-available/
    /etc/php/conf-enabled/
    

    with symliks from the second to the other and an include to that one.

提交回复
热议问题