8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

nginx+php-fpm環境でのCakePHPで"Warning (2): session_start()"エラーが出る

Posted at

##環境
OS: CentOS 6.4
Web: nginx 1.4.2
PHP: php-fpm 5.4.17
CakePHP: 2.3.8

##エラー内容
上記の環境下でCakeインスト後ダッシュボード(?)画面で

Warning (2): session_start(): open(/var/lib/php/session/sess_*******, O_RDWR) failed: No such file or directory (2) [CORE/Cake/Model/Datasource/CakeSession.php, line 618]

##調べてみる

$ vim /etc/php.ini
; RPM note : session directory must be owned by process owner
; for mod_php, see /etc/httpd/conf.d/php.conf
; for php-fpm, see /etc/php-fpm.d/*conf
;session.save_path = "/tmp"

$ vim /etc/php-fpm.d/www.conf
php_value[session.save_path] = /var/lib/php/session

$ ls /var/lib/php

フォルダがない。

##解決策

$ sudo mkdir /var/lib/php/session
$ sudo chown nginx.nginx /var/lib/php/session
8
8
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
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?