2

Warning: session_start(): open(/var/cpanel/php/sessions/ea-php56/sess_c84fdb91458e26c7325faf74a529a3, O_RDWR) failed: No such file or directory (2) in /home/username/public_html/test2.php on line 3

Warning: session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php56) in /home/username/public_html//test2.php on line 3

Notice: Undefined index: username in /home/username/public_html/test2.php on line 4

i used this code but add

(error_reporting(E_ALL); 
ini_set('display_errors', 1);) 

to above of test2.php

Wria Mohammed
  • 1,433
  • 18
  • 23

1 Answers1

5

Your session directory /var/cpanel/php/sessions/ea-php56/ on sever may be not exist or you do not have permissons to access to it.

Create directory if not exist with proper permissions or change session directory in php.ini file. If you dont have access to server contact your service provider.

You can set below line before accesing or creating sesssion to change session directory for your script.

ini_set('session.save_path', '/path/to/your/folder')

https://www.php.net/manual/en/function.session-save-path.php

SachinPatil4991
  • 774
  • 6
  • 13