php - 无法使用 Yii::log 在 linux 中写入日志?

标签 php linux yii rhel

在基于 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/

相关文章:

php - 从 mysql_fetch_assoc() 以相反的顺序回显

php - 使用 JQuery 验证并通过 PHP 处理

node.js - Linux 统一编辑器 : unity-editor depends on npm; however: Package npm is not installed

mysql - 如何从 mysql 数据库中提取数据并使用 yii-framework 将它们绘制在 highcharts 中

php - 从 Postcode DB 获取 lat/lng 并在 PHP/MYSQL 中按最近的顺序排序

php - 当我连接两个表时,不返回空值。返回以前的数据

linux - 单用户模式下从linux内核到用户空间共享内存

linux - 在目录下列出所有内容,并提供详细信息(Linux Shell命令)

php - 如何在 yii 的更新 View 中加载多个下拉列表中的选定值?

json - Yii2 RESTful Web服务: JSON Request Format