简体   繁体   English

在Windows IIS服务器上未记录PHP错误

[英]Not logging PHP errors on windows IIS server

We're running an IIS website on a dedicated windows server which has Plesk 12 on it. 我们正在专用Windows服务器上运行IIS网站,该服务器上装有Plesk 12。 We're having trouble getting PHP scripts to log any errors they encounter. 我们很难让PHP脚本记录它们遇到的任何错误。 In the php.ini we have tried setting both error_log="C:/Inetpub/vhosts/site_name/logs/php_errors.txt" and error_log="C:\\Inetpub\\vhosts\\site_name\\logs\\php_errors.txt" . 在php.ini中,我们尝试设置error_log="C:/Inetpub/vhosts/site_name/logs/php_errors.txt"error_log="C:\\Inetpub\\vhosts\\site_name\\logs\\php_errors.txt" We have also set error_reporting=E_ALL and log_errors=1 . 我们还设置了error_reporting=E_ALLlog_errors=1 When checking phpinfo() these changes are shown. 当检查phpinfo()时,将显示这些更改。 Finally we have made sure the correct users have read/write permissions on the text file. 最后,我们确保正确的用户对文本文件具有读/写权限。

Any ideas why it isn't logging? 有什么想法为什么不记录?

Actually the reason in permissions. 实际上是权限的原因。

Provide permission for Application pool group (IWPG_) for your log file 为您的日志文件提供应用程序池组(IWPG_)的权限

You can do it in "File Manager": 您可以在“文件管理器”中执行此操作: plesk-file-manager-add-permissions-1.png

plesk-file-manager-add-permissions-2.png

plesk-file-manager-add-permissions-3.png

JFYI there is also "Additional read/write permission" on domains hosting settings, it's affects whole "httpdocs" folder JFYI在托管设置的域上还具有“附加读/写权限”,它会影响整个“ httpdocs”文件夹

Better is to call the file "php_errors.log" and put it into the log directory used by the server for the access log (ie "W3SVC6"). 更好的方法是调用文件“ php_errors.log”,并将其放入服务器用于访问日志的日志目录(即“ W3SVC6”)。 In this way you can see the log in plesk with all standard log features. 这样,您可以在plesk中看到具有所有标准日志功能的日志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM