1

我正在尝试使用特使部署我的 laravel 项目。每次我跑

特使运行部署

我收到此错误消息:

[deploybot@"serversip"]: PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'The stream
or file "/home/spark/storage/logs/laravel.log" could not be opened: failed  to open stream: Permission denied' in /home/s
park/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87

错误消息要大得多,但我觉得问题可能与我对某些目录/文件的权限有关?

我的 envoy.blade.php

@servers( ['production' => 'deploybot@url' ])

@task('deploy', ['on' => 'production'])
cd /home/spark/
php artisan down
git reset --hard HEAD
git pull origin master
php dump-autoload
php artisan migrate --force
php artisan up
@endtask

我的项目目录的许可:

drwxr-xr-x 14 apache apache   4096 Dec  1 11:09 .
drwxr-xr-x 12 root   root     4096 Nov 25 14:50 ..
drwxr-xr-x 10 apache apache   4096 Dec  1 11:09 app
-rw-rw-r--  1 apache apache   1646 Dec  1 11:09 artisan
-rw-rw-r--  1 apache apache    320 Dec  1 11:09 behat.yml
drwxr-xr-x  3 apache apache   4096 Dec  1 11:09 bootstrap
-rw-rw-r--  1 apache apache   1665 Dec  1 11:09 composer.json
-rw-rw-r--  1 apache apache 143008 Dec  1 11:09 composer.lock
drwxr-xr-x  2 apache apache   4096 Dec  1 11:09 config
drwxr-xr-x  5 apache apache   4096 Dec  1 11:09 database
-rw-r--r--  1 apache apache    289 Nov 23 19:16 .env
drwxr-xr-x  3 apache apache   4096 Dec  1 11:09 features
drwxr-xr-x  8 apache apache   4096 Dec  1 11:20 .git
-rw-rw-r--  1 apache apache    135 Dec  1 11:09 .gitignore
-rw-rw-r--  1 apache apache    503 Dec  1 11:09 gulpfile.js
-rw-rw-r--  1 apache apache    159 Dec  1 11:09 package.json
-rw-rw-r--  1 apache apache     87 Dec  1 11:09 phpspec.yml
-rw-rw-r--  1 apache apache    899 Dec  1 11:09 phpunit.xml
drwxr-xr-x  5 apache apache   4096 Dec  1 11:09 public
-rw-rw-r--  1 apache apache   1928 Dec  1 11:09 README.md
drwxr-xr-x  5 apache apache   4096 Nov 23 19:15 resources
-rw-rw-r--  1 apache apache    567 Dec  1 11:09 server.php
drwxr-xr-x  2 apache apache   4096 Dec  1 10:40 .ssh
drwxr-x---  5 apache apache   4096 Nov 23 19:15 storage
drwxr-xr-x  2 apache apache   4096 Dec  1 11:09 tests
-rw-rw-r--  1 apache apache    494 Dec  1 11:09 Vagrantfile
drwxr-xr-x 39 apache apache   4096 Nov 30 10:56 vendor
4

1 回答 1

0

您需要授予存储文件夹的权限。 chmod -fR 777 存储/*

这会为你做的。

于 2016-08-19T12:27:53.127 回答