1

During Magento 2 installation it reach 65% and stuck with below error:

Installing user configuration...

[ERROR] Exception: Warning: SessionHandler::read(): open(/var/lib/php/session/sess_dut4kvc67t0gvapfoo399b65d1, O_RDWR) failed: Permission denied (13)..

permission is 777 to var folder, i'm using plesk 12.5.30 with php 7

what could be the issue?

Raphael at Digital Pianism
  • 70,385
  • 34
  • 188
  • 352
Ahmad Darwish
  • 596
  • 2
  • 12
  • 24

3 Answers3

1

This happens when your session.save_handler PHP parameter is set to some another session storage than files (for example, redis, memcached, and so on). This is a known issue we’re working to resolve.
For More detail see here

For Directory Permission see here

Arunendra
  • 7,446
  • 3
  • 29
  • 54
1

As a quick fix you can set app/etc/env.php like so:

array (
  'save' => 'files',
  'save_path' => '/tmp',
),

tmp is always readble and writable by everyone.

It is clearly a permissions issue. Espescially when running with nginx and php-fpm

tread
  • 1,083
  • 2
  • 13
  • 36
-1

I believe the correct permissions are 0770 And the owner should be the web server, in my case: nginx chown -R nginx:nginx /var/lib/php/session

Since my original posting I have determined the actual problem is the php upgrades. When php is upgraded, the owner is changed to 'apache' which is php's default setting.

This is a known issue and causes problems to any one whose web server is not 'apache'. Until such time as php recognizes the there is life beyond apache and leaves the 'owner' as is if it exists, this is going to cause problems.

Solution:

  • If you don't have an 'apache' user/group then add it: useradd -s /sbin/nologin apache
  • Make 'apache' the owner: chown -R apache:apache /var/lib/php/session
  • Add your web user to the apache group: gpasswd -a psacln apache
  • For others: gpasswd -a [web-user] apache eg. gpasswd -a nginx apache

The next time php is upgraded you won't find your site inaccessible. I suspect this will be addressed by php at some point but it hasn't been as of this week.

I don't understand why MagenX didn't provide an explanation and solution rather than a somewhat meaningless comment.

ITI
  • 1
  • 1