Setting PHP Include Path on a per site basis?

后端 未结 7 1242
既然无缘
既然无缘 2020-12-20 11:25

I can set the PHP include path in the php.ini:

include_path = /path/to/site/includes/

But then other websites are affected so

7条回答
  •  隐瞒了意图╮
    2020-12-20 12:06

    If you're using apache as a webserver you can override (if you allow it) settings using .htaccess files. See the PHP manual for details.

    Basically you put a file called .htaccess in your website root, which contains some PHP ini values. Provided you configured Apache to allow overrides, this site will use all values in your PHP config, + the values you specify in the .htaccess file.

    Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives

    as stated in the page I linked. If you click through to the full listing, you see that the include path is a PHP_INI_ALL directive.

提交回复
热议问题