PHP Fatal error: Uncaught exception 'think\exception\ErrorException' with message 'error_log(C:\mall.qifeisoft.com\tailing\runtime\log\202307\13.log): failed to open stream: Permission denied' in C:\mall.qifeisoft.com\tailing\thinkphp\library\think\log\driver\File.php:169 Stack trace: #0 [internal function]: think\Error::appError(2, 'error_log(C:\\ma...', 'C:\\mall.qifeiso...', 169, Array) #1 C:\mall.qifeisoft.com\tailing\thinkphp\library\think\log\driver\File.php(169): error_log('---------------...', 3, 'C:\\mall.qifeiso...') #2 C:\mall.qifeisoft.com\tailing\thinkphp\library\think\log\driver\File.php(75): think\log\driver\File->write(Array, 'C:\\mall.qifeiso...', false, true) #3 C:\mall.qifeisoft.com\tailing\thinkphp\library\think\Log.php(179): think\log\driver\File->save(Array, true) #4 C:\mall.qifeisoft.com\tailing\thinkphp\library\think\Error.php(93): think\Log::save() #5 [internal function]: think\Error::appShutdown() #6 {main} thrown in C:\mall.qifeisoft.com\tailing\thinkphp\library\think\log\driver\File.php on line 169
时间: 2023-07-22 08:12:46 浏览: 187
这个错误是因为你的 PHP 程序没有足够的权限来写入日志文件,导致出现了 "Permission denied" 的错误。解决这个问题,你可以尝试以下几个步骤:
1. 检查目录权限:确保日志文件所在的目录 `C:\mall.qifeisoft.com\tailing\runtime\log\202307\` 具有写入权限。你可以通过修改目录权限或者将其设置为可写入状态来解决该问题。
2. 检查文件权限:检查日志文件 `13.log` 是否可写入。你可以尝试修改文件权限,或者删除该文件以重新创建一个新的可写入的日志文件。
3. 检查目录及文件所属用户和组:确保目录和文件所属用户和组与 PHP 进程的用户和组相匹配。你可以通过修改文件所有者或者更改 PHP 进程的用户和组来解决该问题。
4. 检查 SELinux 配置(仅适用于 Linux 系统):如果你的服务器启用了 SELinux 安全模块,它可能会限制 PHP 程序对文件系统的访问。你可以通过修改 SELinux 配置或者禁用 SELinux 来解决该问题。
请注意,具体解决方法可能因你的服务器环境和配置而有所不同。如果你不确定如何操作,建议咨询服务器管理员或者开发人员进行进一步排查和解决。
阅读全文