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?

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

  • my session.save_handler is set to files, pls see herara.com/phpinfo.php – Ahmad Darwish Feb 26 '16 at 12:54
  • Please upgrade your magento 2 code.It will solve your problem, Please read the given link – Arunendra Feb 26 '16 at 12:58
  • no success, i've noticed this error only after upgrade php on centos 7 from 5.4 to 5.6 – Ahmad Darwish Feb 26 '16 at 13:20
  • Make sure your /var folder should have write permission. – Arunendra Feb 26 '16 at 13:43
  • 1
    as mentioned in my question all proper permission applied – Ahmad Darwish Feb 27 '16 at 8:30
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

-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.

  • as you know in plesk the owner will be psacln and can not be nginx or apache – Ahmad Darwish Mar 5 '16 at 9:47
  • this will be overridden when you upgrade php – MagenX Mar 5 '16 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.