0

I am working on a project which uses codeigniter 3.1.11 as base. It is 90% completed and the development environment is Ubuntu 18.04 with php 7.2.

Due to some other issues, I am happened to switch to Fedora, I have configured php 7.3.16 with all the other LAMP stack.

I am facing a issue in my code igniter as follows

session_start(): Failed to initialize storage module: user (path: /var/www/html/apps/guest_house/assets/sessions)

Where as my session configs goes like

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'iisertvm_guest_house';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = FCPATH.'/assets/sessions/';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

Where as the sessions directory has 777.

I have found similar issue, but the solution is to upgrade to the latest Codeingiter and php, where as I am in latest codeigniter and php.

Note : The same source files run flawlessly in my workplace server which has Cent OS 6 with PHP 5.6

I am new to RedHat based distro where Ubuntu has been my home for several years.

Kindly help me. Thanks in advance.

deceze
  • 510,633
  • 85
  • 743
  • 889
sakthidas
  • 69
  • 3
  • 5
  • Please **edit** and show why this is not a duplicate.... – Martin Apr 03 '20 at 10:10
  • Can you confirm that your full path exist? – Martin Apr 03 '20 at 10:13
  • Can you confirm that *every* part of the path is accessible as 777? It's nice if `sessions` is 777, but if any part of the path before that is not accessible to the webserver that doesn't help. – deceze Apr 03 '20 at 10:15
  • Also it looks like you're storing the session data within the public html folder area, that is publically accessible..... this isn't good at all from a security perspective.... – Martin Apr 03 '20 at 10:16
  • Yes.. I have made entire /var/www/html as 777 to make sure that it is writable by php, also the owner of the path /var/www/html/ is apache – sakthidas Apr 03 '20 at 10:17
  • @Martin Thank you for the suggestion, it is 777 only in my development machine. – sakthidas Apr 03 '20 at 10:18
  • 1
    https://stackoverflow.com/questions/49235177/codeigniter-session-cookie-not-sent-to-server – Martin Apr 03 '20 at 10:20
  • @Martin Yes the path exist, It runs flawlessly in ubuntu 18.04 with php 7.2 – sakthidas Apr 03 '20 at 10:20

1 Answers1

1

Now the problem is fixed. Earlier SElinux mode was enforcing After setting it to permissive it works fine.

sakthidas
  • 69
  • 3
  • 5