larave 5 could not be opened: failed to open stream: Permission denied

原创 2015年11月19日 17:37:59

以前使用的是ubuntu系统,最近换了fedora用,LNMP下以前项目运行没问题,这次不行了,查看php-fpm(tail /var/log/php-fpm/www-error.log)的错误日志如下:

[19-Nov-2015 13:52:42 Asia/Shanghai] PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/usr/share/nginx/wakav/storage/logs/laravel-2015-11-19.log" could not be opened: failed to open stream: Permission denied' in /usr/share/nginx/wakav/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87
Stack trace:
#0 /usr/share/nginx/wakav/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(88): Monolog\Handler\StreamHandler->write(Array)
#1 /usr/share/nginx/wakav/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\RotatingFileHandler->write(Array)
#2 /usr/share/nginx/wakav/vendor/monolog/monolog/src/Monolog/Logger.php(289): Monolog\Handler\AbstractProcessingHandler->handle(Array)
#3 /usr/share/nginx/wakav/vendor/monolog/monolog/src/Monolog/Logger.php(565): Monolog\Logger->addRecord(400, 'exception 'Symf...', Array)
#4 /usr/share/nginx/wakav/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(47): Monolog\Logger->error('exception 'Symf...')
 in /usr/share/nginx/wakav/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 87

后来请运维的高手看了下说是Selinux的问题,把Selinux关闭掉重启就好了。
查看Selinux状态:
1、

/usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态

SELinux status:                 enabled

2、getenforce ##也可以用这个命令检查(这个没试过)

关闭SELinux:

1、临时关闭(不用重启机器):

setenforce 0                  ##设置SELinux 成为permissive模式

    ##setenforce 1 设置SELinux 成为enforcing模式

2、修改配置文件需要重启机器:

修改/etc/selinux/config 文件

SELINUX=enforcing改为SELINUX=disabled

重启系统即可

Author:leedaning
本文地址:http://blog.csdn.net/leedaning/article/details/49930989

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

PHP之Laravel框架使用问题汇总与解决方式

Laravel作为市场上最受欢迎的PHP MVC框架之一,有许多开发者用户在使用Laravel。最近刚刚接触Laravel框架,也遇到了一些问题,这里总结经验并将解决方式记录如下,希望对遇到同样问题的...

laravel错误处理...app/storage/sessions...failed to open stream: Permission denied

方法:到laravel跟目录下执行如下操作: 1)php artisan cache:clear  2)chmod -R 777 app/storage 3)php artisan dump-a...

the file “XXX” could not be opened because you don't have permission to view it

今天使用Xcode6,突然提示我"the file “XXX” could not be opened because you don't have permission to view it"  说...

the file “XXX” could not be opened because you don't have permission to view it

the file “XXX” could not be opened because you don't have permission to view it  分类: iphone2014...
  • Lu_Ca
  • Lu_Ca
  • 2015-09-30 11:34
  • 389

Starting httpd: (13)Permission denied: make_sock: could not bind to address [::]

In Fedora Core 5/6 and RHEL 5. We have made it easier to customize certain common parts of SELinux. ...

linux 下apche无法监听端口解决办法(Permission denied: make_sock: could not bind to address)

想建立一个测试用的虚拟主机,遇到了这个问题:[root@localhost html]# service httpd startStarting httpd: httpd: Could not rel...
  • xxw365
  • xxw365
  • 2011-07-08 12:00
  • 4228

Hello Stub failed to open hello Permission denied

Hello Stub:failed to open /dev/hello – Permission deniedAndroid 6.0中 在HAL层的代码要访问/dev/hello的时候出现了Hell...

Permission denied: make_sock: could not bind to address [::]:81 Apache 虚拟主机

想建立一个测试用的虚拟主机,遇到了这个问题: [root@localhost html]# service httpd start Starting httpd: httpd: Could not...

httpd 13 permission denied make_sock could not bind to address 失败的原因

仔细检查了一遍配置文件httpd.conf,找到这么一段:  代码如下 复制代码     Options FollowSymLinks     AllowOverride None     Orde...

Failed to connect to the specified server. Server library could not be loaded

这个错误是前几天用户提出了的,我今天又一次遇到了,特拿出来跟大家分享一下 问题背景: 使用ArcCatalog直连远程服务器,数据库为Oracle,提示“Error: Server libra...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)