GoDaddy Windows Plex PHP error_log 无法正常工作

GoDaddy Windows Plex PHP error_log not working right

我遇到了一个问题,我的 php 页面上出现了 "Internal Server Error"。为了尝试调试它,我尝试在 php 中使用 error_log 函数。但是我无法让它向错误日志写入任何内容。即使在一个简单的 php 文件中:

httpdocs/temp.php

<?php
error_log("this is an error");
echo "hello";
?>

我会收到一条基本的内部服务器错误消息:

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Web Server at xxxxxxxx.com

所以我查看了如何正确设置 error_log,认为它设置不正确。我找到了这个 article.

因为我在 windows 我编辑了我的 httpdocs 根文件夹中的 .user.ini 文件并添加了 error_log 行:

httpdocs/.user.ini

[PHP]
error_log=G:\PleskVhosts\xxxxxxxxxx.com\httpdocs\php_error.log
display_errors=off
log_errors=on
open_basedir="G:/PleskVhosts//xxxxxxxxx.com\;C:\Windows\Temp\"
safe_mode=off
sendmail_from=xxxxxxxxx@xxxxxxxxx.shr.prod.phx3.secureserver.net
SMTP=relay-hosting.secureserver.net

这个article帮我得到了绝对路径

我重新启动了 IIS 应用程序池并在我的 httpdocs 文件夹中创建了一个空的 php_error.log 文件,但是它仍然没有向日志文件写入任何内容,并且继续只显示内部服务器错误。我还尝试删除 .user.ini 文件中除 error_log 行之外的所有其他行,重新启动,但仍然没有。我也试过停止应用程序池并再次启动它,仍然没有。

我仔细检查了 phpinfo,log_errors 字段设置为打开,并且为 error_log 设置了正确的目录。所以它看到了 .user.ini 文件。

我试着打电话给他们的支持,但他们帮不了我。

他们将我链接到有关 IIS 错误处理的 article。我创建了一个 web.config 文件并将其放在 httpdocs 文件夹中,如该文章中所述。现在我得到了一些不同的东西。现在我页面的输出是我传递给 error_log 的错误。所以换句话说,当我访问 test.php 时,屏幕上的输出显示:

this is an error

注意 php 脚本是如何在出错后死掉的?错误不仅不应该显示在屏幕上(它应该放在 php_error.log 文件中,此时还没有被写入),而且 php 脚本不应该在之后消失,除非它遇到了致命错误。我应该从回显中看到 "hello",但我没有。

我需要做什么才能使其正常工作?

我的托管计划安装了 IIS 8 和 PHP 5.4。

PS。他们的支持基本上说他们无法进一步帮助我,因为更改配置文件是 "coding" 而且他们不提供编码支持。

PHP 需要文件读写权限