【发布时间】:2018-06-09 11:13:10
【问题描述】:
我发现当通过cli执行php时,php可以访问自定义windows系统环境变量,但在IIS运行php时没有。
例如,我可以把这个放在php.ini中:
zend_extension="${PHP_PATH}ext\php_xdebug-2.5.5-7.1-vc14-nts.dll"
当通过 cli 调用时,php 会正确加载 xdebug:
c:\>php.exe -v
MSVC14 (Visual C++ 2015) x86 ) Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.1, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick RethansPHP 7.1.1 (cli) (built: Jan 18 2017 18:50:48) ( NTS
但是当我在 IIS 提供的页面上调用 phpinfo() 时,Xdebug 没有出现。我假设这是因为 IIS 无法访问我创建的自定义系统变量。有人可以告诉我如何使这些变量在 IIS 中可访问,最好以我可以编写脚本的方式(无论是通过批处理文件、power shell 还是其他方式)进行自动化部署。
【问题讨论】: