在基于 Yii 的 Web 应用程序中,我正在使用编写日志文件
Yii::log('info', CLogger::INFO, $exception);
它在 Windows 中完美运行。但是当我在 RHEL 6.0 中尝试这个时,它没有写入也没有显示任何错误响应
我也更改了目录权限
chmod 777 /var/www/html/yiiblog/protected/runtime
但是它不工作并且在 apache 的错误日志中没有显示任何东西
这是什么原因以及如何解决这个问题?
最佳答案
你的 chmod 命令是错误的。试试这个,看看 documentation .
chmod 0777 /var/www/html/yiiblog/protected/runtime
没错,这就是777/0777的区别。
0777 (octal) == binary 0b 111 111 111 == permissions rwxrwxrwx (== decimal 511)
777 (decimal) == binary 0b 1 100 001 001 == permissions sr----x--x (== octal 1411)
关于php - 无法使用 Yii::log 在 linux 中写入日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25532682/