简体   繁体   English

将错误记录到文件(PHP + IIS6 + FastCGI + Win2003服务器)

[英]Log errors to file (PHP + IIS6 + FastCGI + Win2003 Server)

Though I have read lots of posts and pages concerning the issue (shown below), I guess I'm missing something here. 虽然我已经阅读了很多关于这个问题的帖子和页面(如下所示),但我想我在这里遗漏了一些东西。 The mais issue is: my PHP errors are not being logged to the file specified nor to the system event log . mais问题是: 我的PHP错误没有记录到指定的文件中,也没有记录到系统事件日志中

My phpinfo() shows : Windows Server 2003, PHP 5.3.6, log_errors = On, error_log = C:\\\\errorphp.log 我的phpinfo()显示 :Windows Server 2003,PHP 5.3.6,log_errors = On,error_log = C:\\\\ errorphp.log

I have tried both error_log = C:\\Inetpub\\logs\\php.log and error_log = syslog in php.ini to no effect (either one at a time). 我已经尝试了php.ini中的 error_log = C:\\Inetpub\\logs\\php.logerror_log = syslog都没有效果(一次一个)。

I have: 我有:

  1. restarted IIS after every php.ini change 每次php.ini更改后重新启动IIS
  2. granted the IUSR_XXXXX User Modify permissions on the folder AND the file 授予文件夹和文件的IUSR_XXXXX用户修改权限
  3. tried leaving the directory blank and letting PHP create the file 尝试将目录留空并让PHP创建文件
  4. had a headache. 头疼。

Any help is much appreciated. 任何帮助深表感谢。

references: 引用:

In my case, setting 在我的情况下, 设置

fastcgi.logging = 1

in php.ini solved the issue and I do have the log file working now (I left the file creation to php itself, my directory was blank ) 在php.ini解决了这个问题,我现在有日志文件工作(我把文件创建留给php本身, 我的目录是空白的

I'd never guess that as the php.ini itself states (right above the stated config) 我永远不会猜到,因为php.ini本身就说明了(正好在陈述的配置之上)

; ; Disable logging through FastCGI connection. 禁用通过FastCGI连接的日志记录。 PHP's default behavior is to enable this feature. PHP的默认行为是启用此功能。

Go figure. 去搞清楚。

Have you 有你

  • checked your error_reporting level 检查了你的error_reporting级别
  • tried setting a log file inside the document root (incl. permission to write) to see if any restrictions apply? 尝试在文档根目录中设置一个日志文件(包括写入权限)以查看是否有任何限制?

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

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