我有一个由zend服务器部署的laravel 5项目,在我的代码中出现错误之前,一切似乎都正常,这导致框架需要写入日志文件。在那一点上,Zray告诉我这个错误
未捕获的异常“unexpectedvalueexception”,消息为“the stream or file“/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/storage/logs/laravel.log”无法打开:未能打开/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/vendor/monog/monog/src/monog/handler/streamhandler.php:97堆栈跟踪:0/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/vendor/monolog/src/monolog/handler/abstractprocessinghandler.php(37):monolog\handler\streamhandler->write(array)1/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/vendor/monolog/monolog/src/monolog/logger.php(336):monog\handler\abstractprocessinghandler->handle(array)2/usr/local/zend/var/apps/http/vtribes.local/80/2.1_/vendor/monog/monog/src/monog/logger.php(615):monog\logger->addrecord(400,object(unexpectedvalueexception),数组)3/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/vendor/laravel/framework/src/illumed/log/writer.php(202):monolog\logger->error(object(unexpectedvalueexception),array)4/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/vendor/laravel/framework/src/illumed/log/writer.php(113):illumed\log\writer->writelog(“error”,对象(意外值异常),数组)5/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/vendor/laravel/framework/src/illume/foundation/exceptions/handler.php(56):illume\log\writer->error(object(unexpectedvalueexception))6/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/app/exceptions/handler.php(36):illuminate\foundation\exceptions\handler->report(object(unexpectedvalueexception))7/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/vendor/laravel/framework/src/illuminate/foundation/bootstrap/handleexceptions.php(79):app\exceptions\handler->report(object(unexpectedvalueexception))8[内部函数]:illuminate\foundation\bootstrap\handleexceptions->handleexception(object(unexpectedvalueexception))抛出9{main}
这里的问题是

/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/storage/logs/laravel.log

不仅归我所有,组是zend,文件权限是777。我已经尝试了此文件的所有用户/组/模式权限,但Zray仍然显示相同的错误。我甚至删除了文件,然后触摸它。
-rwxrwxrwx。1 Paul Zend 5月0日24 00:17/usr/local/zend/var/apps/http/vtribes.local/80/2.1_33/storage/logs/laravel.log
想不想在哪里找到罪犯?
谢谢,
保罗

最佳答案

检查this answer。若要访问文件,必须对所有父目录具有“执行”权限。对你来说
/usr
/usr/local
/usr/local/zend
等等…
似乎您对应用程序文件夹拥有正确的权限,但storage/logs有问题。检查此目录的执行权限。

关于linux - 日志文件权限错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37442999/

10-13 08:41