Laravel 5 在red hat上运行laravel应用程序

Laravel 5 在red hat上运行laravel应用程序,laravel-5,redhat,Laravel 5,Redhat,我试图在RHEL-7.3上运行laravel应用程序,因为我已经安装了apache和php,我已经上传了/var/www/html文件夹中的代码,我设置了laravel 777和存储文件夹777的权限 我可以使用php artisan Service运行代码,但在错误日志中我得到了错误信息 [Sun Jul 02 09:15:19.810149 2017] [:error] [pid 10328] [client 182.72.84.254:58880] PHP Fatal error: U

我试图在RHEL-7.3上运行laravel应用程序,因为我已经安装了apache和php,我已经上传了/var/www/html文件夹中的代码,我设置了laravel 777和存储文件夹777的权限

我可以使用php artisan Service运行代码,但在错误日志中我得到了错误信息

[Sun Jul 02 09:15:19.810149 2017] [:error] [pid 10328] [client 182.72.84.254:58880] PHP Fatal
 error:  Uncaught UnexpectedValueException: The stream or file
  "/var/www/html/kyowebservice/storage/logs/laravel.log" could not be opened: failed to open
 stream: Permission denied in
我不知道我需要什么样的许可才能让拉威尔戴上红帽

ls-拉拉维尔内的la:

 drwxr-xr-x.  5 root     root           98 Jul  2 08:59 .
 drwxrwxrwx.  4 root     root           33 Jul  2 08:59 ..
-rwxr-xr-x.  1 root     root           20 Jul  2 06:38 info.php
drwxr-xr-x. 12 ec2-user ec2-user     4096 Jul  2 08:47 kyolabdemo
-rwxr-xr-x.  1 ec2-user ec2-user 97966762 Jul  2 08:44 kyolabdemo.zip
drwxr-xr-x. 12 ec2-user ec2-user     4096 Jul  2 10:13 kyowebservice
drwxr-xr-x. 13 apache   apache       4096 Jul  2 08:55 laravel
ls-la insdie kyowebservice:

      drwxr-xr-x. 12 ec2-user ec2-user   4096 Jul  2 10:13 .
  drwxr-xr-x.  5 root     root         98 Jul  2 08:59 ..
  -rwxr-xr-x.  1 ec2-user ec2-user   1905 Jul  2 08:05 api
  drwxr-xr-x. 10 ec2-user ec2-user   4096 Jul  2 08:05 app
  -rwxr-xr-x.  1 ec2-user ec2-user   1646 Jul  2 08:05 artisan
  drwxr-xr-x.  3 ec2-user ec2-user     54 Jul  2 08:05 bootstrap
  -rwxr-xr-x.  1 ec2-user ec2-user   1305 Jul  2 08:05 composer.json
  -rwxr-xr-x.  1 ec2-user ec2-user 128082 Jul  2 08:05 composer.lock
  drwxr-xr-x.  2 ec2-user ec2-user    228 Jul  2 10:17 config
  drwxr-xr-x.  5 ec2-user ec2-user     72 Jul  2 08:05 database
  -rwxr-xr-x.  1 root     root        236 Jul  2 10:15 .env
  -rw-r--r--.  1 root     root         31 Jul  2 10:13 .env6
  drwxr-xr-x.  8 ec2-user ec2-user    163 Jul  2 08:05 .git
  -rwxr-xr-x.  1 ec2-user ec2-user     61 Jul  2 08:05 .gitattributes
  -rwxr-xr-x.  1 ec2-user ec2-user    103 Jul  2 08:05 .gitignore
  -rwxr-xr-x.  1 ec2-user ec2-user    503 Jul  2 08:05 gulpfile.js
  -rwxr-xr-x.  1 ec2-user ec2-user  69411 Jul  2 08:05 index.html
  -rwxr-xr-x.  1 ec2-user ec2-user  69411 Jul  2 08:05 index.html.1
  -rwxr-xr-x.  1 ec2-user ec2-user    212 Jul  2 08:05 package.json
  -rwxr-xr-x.  1 ec2-user ec2-user   1026 Jul  2 08:05 phpunit.xml
  drwxr-xr-x.  8 ec2-user ec2-user    191 Jul  2 08:05 public
  -rwxr-xr-x.  1 ec2-user ec2-user   1918 Jul  2 08:05 readme.md
  drwxr-xr-x.  5 ec2-user ec2-user     45 Jul  2 08:05 resources
  -rwxr-xr-x.  1 ec2-user ec2-user    567 Jul  2 08:05 server.php
  drwxr-xr-x.  5 ec2-user ec2-user     46 Jul  2 08:05 storage
  drwxr-xr-x.  2 ec2-user ec2-user     49 Jul  2 08:05 tests
  drwxr-xr-x. 29 ec2-user ec2-user   4096 Jul  2 08:06 vendor

我找到了这个问题的解决方案,它与linux权限无关。在redhat中有一种叫做SElinux的东西。我在Redhat中禁用了SE linux,它工作了,为此我编辑了文件:/etc/selinux/config

      # This file controls the state of SELinux on the system.
  # SELINUX= can take one of these three values:
  #       enforcing - SELinux security policy is enforced.
  #       permissive - SELinux prints warnings instead of enforcing.
  #       disabled - No SELinux policy is loaded.
  SELINUX=disabled
  # SELINUXTYPE= can take one of these two values:
  #       targeted - Targeted processes are protected,
  #       mls - Multi Level Security protection.
  SELINUXTYPE=targeted

我编辑了SELINUX=disabled,然后重新启动服务器,laravel将工作。

您可以编写设置权限的命令吗?您还可以编写
ls-al/var/www/html/kyowebservice/storage/logs的结果
文件夹和存储的权限为755644,内部存储文件夹的权限应为777更新ls-la