IIS下运行时报错
我试图让我在 IIS 下安装的 PHP 显示错误,但我一点运气都没有。 我
error_reporting(E_ALL);
在脚本中尝试过,但什么也没有显示,只是一个空白屏幕。
我尝试编辑我的 PHP.ini 文件并设置
error_reporting = E_ALL
display_errors = On
也尝试过,
error_reporting = E_ALL
display_errors = stdout
但当我的脚本抛出错误时,屏幕上根本没有显示任何内容。
有什么建议吗?
I am trying to get my install of PHP under IIS to display errors, but I'm having no luck at all. I tried
error_reporting(E_ALL);
in the script, and nothing shows up, just a blank screen.
I tried editing my PHP.ini file and setting
error_reporting = E_ALL
display_errors = On
Also tried
error_reporting = E_ALL
display_errors = stdout
but nothing is showing up on the screen at all when my scripts throw errors.
Any advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在php安装路径中的php.ini上将错误显示的值更改为on
on php.ini in the php installation path change the value of error display to on
也许 IIS 阻止了您的错误显示。
尝试:
为像我这样的谷歌用户而发布。
Perhaps IIS is blocking your errors from displaying.
Try:
Posted for the sake of googlers like me.
很抱歉复活了一个死帖子,但我遇到了类似的问题,并通过在我的 PHP 代码中执行此操作解决了它:
这消除了编辑服务器配置的需要,并且还允许我仅使用我认为有问题的方法来执行此操作。
Sorry to resurrect a dead post but I had a similar issue and solved it by doing this in my PHP code:
This obviated the need to edit the server config and also allowed me to do this in just the method that I thought was problematic.
确保您在正确的位置编辑 PHP 文件; IIS 可以在 C:\WINDOWS 中查找 php.ini 文件,而不是在 PHP ISAPI 或 CGI 模块的安装位置中查找。 检查 phpinfo() 的输出; 以确定您正在编辑正确的 php.ini 文件。 此外,您需要重新启动 IIS 服务(或整个计算机),这些更改才会生效。
Ensure that you're editing the PHP file in the correct location; IIS can look for a php.ini file in C:\WINDOWS rather than the install location of the PHP ISAPI or CGI module. Check the output of phpinfo(); to determine you're editing the correct php.ini file. Also, you need to restart the IIS service (or the computer overall) before those changes will be put into effect.