我有 IIS 7.0 和两个版本的 PHPv5
and v7
在我的 Microsoft Windows Server 2008 Standard 6.0 SP2 上。问题是,PHP7 或 IIS 尝试将 PHP5 的 php.ini 用于 IIS“网站”。
所以在命令行上一切都很好:
X:\>php -v
PHP 7.0.2 (cli) (built: Jan 6 2016 12:59:59) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
X:\>php --ini
Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File: D:\Data\Programme\php7\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
但在 IIS 管理器和phpinfo()
输出不是:
我认为,这是一个 PHP (cgi-fcgi
SAPI)问题,notIIS 问题(但不确定)。
如何设置正确php.ini
适用于 Windows Server 2008 上的 PHP CGI/FastCGI SAPI?
还通过注册表进行了尝试,但这没有帮助:
The solution https://stackoverflow.com/a/38526818/2019043 of Jan Reilink https://stackoverflow.com/users/1297898/jan-reilink seems also correct, but unfortunately I could not find out, how to apply it the right way (see this https://stackoverflow.com/questions/38503625/how-to-set-the-php-ini-path-for-php-cgi-fastcgi-sapi-on-windows-server-2008-r2?noredirect=1#comment64517694_38526818 and other my comments below Jan's answer).
最后我通过 IIS GUI 解决了这个问题:
进而FastCGI Settings -> EnvironmentVariables -> PHPRC
:
也可以看看 ”配置 IIS 以处理 PHP 请求 http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis#Configure_handler_mapping” 在 IIS 文档的“使用 FastCGI 在 IIS 7 上托管 PHP 应用程序”一章中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)