Setting PHP Include Path on a per site basis?

后端 未结 7 1267
既然无缘
既然无缘 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条回答
  •  旧时难觅i
    2020-12-20 12:10

    Use a php.ini file in website root, if your setup uses PHP as CGI (the most frequent case on shared hosts) with the same syntax as the server-wide php.ini; put it into .htaccess if you have PHP as an Apache module (do a phpinfo() if unsure):

    php_value include_path "wherever"
    

    Note that per-folder php.ini does not affects subfolders.

提交回复
热议问题