Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What is going on with this article?
@danishi

artisan up/downがファイル書き込み権限エラーになる

More than 1 year has passed since last update.

Laravelのメンテナンスモードを有効化無効化するartisan up/downコマンドだが、storageディレクトリにApacheなどWebサーバの権限を与えてるとSSHユーザーでコマンドを実行したときに権限エラーになってしまう。

$ php artisan down
Failed to enter maintenance mode.
file_put_contents(/home/user/app/storage/framework/down): failed to open stream: Permission denied

sudo chown -R 777 storageで一時的に権限を変えて書き込めるようにしてもよいが、suでWebサーバーのユーザーに成り代わって書き込むこともできる。

$ sudo -u apache php artisan down
Application is now in maintenance mode.
$ sudo -u apache php artisan up
Application is now live.
1
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
danishi
cloudpack
Amazon Web Services (AWS) の導入設計、環境構築、運用・保守をサポートするマネジドホスティングサービス

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
1
Help us understand the problem. What is going on with this article?