【发布时间】:2015-01-20 16:07:32
【问题描述】:
我创建了一个 Laravel 应用程序并使用 Elastic Beanstalk 将它部署到一个 EC2 实例。除了 PHP 无法写入 storage 目录之外,一切似乎都正常,所以我收到了这个错误:
Error in exception handler: The stream or file "/var/app/current/site/app/storage/logs/laravel.log"
could not be opened: failed to open stream:
No such file or directory in /var/app/current/site/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:84
这对我来说似乎是一个权限问题,所以我尝试使用http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html 的说明来设置权限。
我在.ebextensions 目录中有一个文件01permissions.config:
commands:
storage_permissions:
command: chmod -R 755 $EB_CONFIG_APP_ONDECK/site/app/storage
我在服务器日志中收到以下错误:
[ERROR] Command storage_permissions (chmod -R 755 $EB_CONFIG_APP_ONDECK/site/app/storage) failed
[DEBUG] Command storage_permissions output: chmod: cannot access ‘/site/app/storage’: No such file or directory
有什么想法吗?
【问题讨论】:
标签: laravel amazon-web-services permissions amazon-elastic-beanstalk