LoginSignup
10
10

More than 5 years have passed since last update.

phpのupdateでsessionのpermissionが元に戻る対策

Last updated at Posted at 2014-04-17

問題点

CentOSのphpはyum updateにより更新しているが、更新の度に/var/lib/php/sessionのpermissionが nginx / nginxからroot / apacheに戻ってしまう。webサーバにnginxを使っている場合に、sessionにアクセスできなくなりエラーとなる。

解決策

sessionのフォルダ位置をリセットされないような別の場所に変えるというやり方もあるようだが(未確認)、問題はupdateの際に起こるので、下記のようなaliasを登録してupdateを行うようにする。

alias yup='sudo yum -C update && sudo chown nginx.nginx /var/lib/php/session'

  • yupでアップデート後にpermissionが変更されるようになります。
  • Cオプションはお好みで
10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10