4

After installation of Fresh Magento 2.3 on my sub-domain i got this error.

{"0":"Warning: SessionHandler::read(): open(var/www/html/var/session/sess_nloiac096cn9o6imqdkouoj96l, O_RDWR) failed: No such file or directory (2) in /var/www\$

i have followed some of tutorials but they did not worked.

4
  • did you set 777 permission to var directory May 27, 2019 at 9:03
  • did you restart apache server May 27, 2019 at 9:12
  • do you have session folder available on this path?
    – MagenX
    May 27, 2019 at 9:54
  • i dont know, what if just write files instead of thsi dir?
    – sudo55
    May 27, 2019 at 10:19

5 Answers 5

9

Based on Magento 2.3 Documentation 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).

To solve it follow Magento suggestions :

1 - Upgrade Magento 2 Code

2 - Locate php.ini

php -i | grep "Loaded Configuration File"

As a user with root privileges, open php.ini in a text editor. Locate session.save_handler Set it in any of the following ways:

To comment it out:

;session.save_path = <path>

To set it to a file system path:

session.save_handler = files

3. Open app/etc/env.php

Change:

'session' =>
  array (
    'save' => 'files'
  ),

to

'session' =>
  array (
    'save' => 'db'
  ),
9
  • is this oky now? prntscr.com/nttvef
    – sudo55
    May 27, 2019 at 9:08
  • yes i think it is fine , or you can better just modifie to this : session.save_handler = files , but see if it works when you comment it . May 27, 2019 at 9:16
  • it is not working there are many ;session.save_path available, which one i have to change?
    – sudo55
    May 27, 2019 at 9:24
  • Look for the one that it isnt commented , in your case i guess it is this cl.ly/9227a11ce928 , then after the modification restart apache server : /etc/init.d/httpd restart May 27, 2019 at 9:30
  • i did same as in screenshot but its same prntscr.com/ntubxi
    – sudo55
    May 27, 2019 at 9:39
2

Sometimes js are not loaded because of missing .htaccess in var/pub/static folder. Just check .htaccess file exists or not in hidden files also.

1

Locate php.ini by entering the following command:

php -i | grep "Loaded Configuration File"

Typical locations follow:

  • Ubuntu: /etc/php5/cli/php.ini
  • CentOS: /etc/php.ini

Open php.ini with root user, and comment it out:

;session.save_path =

to

session.save_path = files

3
  • 1
    is this okay? prntscr.com/nttwcp
    – sudo55
    May 27, 2019 at 9:10
  • did you restart apache server May 27, 2019 at 9:13
  • 1
    yes, i did, actully the problem was, i was saving my sessions in files, your answer is fine if someone wants to save sessions in files.
    – sudo55
    May 27, 2019 at 12:02
0

One of the solution for this is to set your 'var' or 'var/sessions' or 'var/sessions' ownership to the web user because Session path can't be written to since the web user and the owner of the content in the sessions folder are different and thus doesn't .

sudo chown -R www-data:www-data var/sessions

0

Restart Nginx or Apache web services

by executing these commands for RHET: systemctl restart httpd /scripts/restartsrv_apache_php_fpm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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