运行 laravel 红帽申请
run laravel application on red hat
我正在尝试在 RHEL-7.3 上 运行 laravel 应用程序,因为我已经安装了 apache 并且 php 我已经在我设置的 /var/www/html 文件夹中上传了代码laravel 777 和存储文件夹 777 的权限。
我可以 运行 使用 php artisan serve 的代码但是在错误日志中我得到错误
[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
我不知道需要什么权限才能在 red hat 中 运行 laravel。
ls -la inside laravel :
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 就可以了。
我正在尝试在 RHEL-7.3 上 运行 laravel 应用程序,因为我已经安装了 apache 并且 php 我已经在我设置的 /var/www/html 文件夹中上传了代码laravel 777 和存储文件夹 777 的权限。
我可以 运行 使用 php artisan serve 的代码但是在错误日志中我得到错误
[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
我不知道需要什么权限才能在 red hat 中 运行 laravel。
ls -la inside laravel :
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 就可以了。