CakePHP:Warning: session_start() [function.session-start: open(/tmp/sess_xxx, O_RDWR) failed: Permission denied (13) [CORE/Cake/Model/Datasource/CakeSession.php line 618]

Published on:
Last updated:

This post is also available in: 日本語 (Japanese)

This is a note of what to do when you got an error "Warning: session_start() " by installing CakePHP.

It is an error that there is no permission to the file in which to save the session.
If you can use the [session.save_path] settings in php.ini, you can be resolved by allowing the writing [/tmp] directory.
You should be careful in the rental server, so there is a case where php.ini is not available.

It is also possible to set the [session.save_path] in .htaccess.

Error Resolution

I modified the file of [app / Config / core.php].
Part of the 219 line of the link(GitHub).

It is described in part commented out of line 181-217 for details.

Configure::write('Session', array(
		'defaults' => 'php'

//After Modify
Configure::write('Session', array(
		'defaults' => 'cake'

Change permissions of folder

After, I was changed to [757] from [755] the permission of [/app/tmp/sessions] folder.

Reference site:
php - CakePHP: Permission denied (13) - Stack Overflow



No tags for this post.

Kuniyoshi Takemoto is the founder of LLC, and editor of this blog( more and follow me on LinkedIn.