我有以下环境:
- 视窗上的 XAMPP
- PHP由mod_php5处理
有人可以告诉我如何为每个项目加载自定义 php.ini 因为目前它只从 XAMP 安装程序的主 php .ini加载。
多谢。
您可以为每个虚拟主机设置 PHPINIDir。
添加到您的 apache 配置:
<VirtualHost *:80>
DocumentRoot c:'www'example1
ServerName www.example.com
PHPINIDir c:'www'example1
# Other directives here
</VirtualHost>
为了处理多个虚拟主机,您应该具有不同的主机名(您可以使用 etc/hosts)或不同的 IP 地址。