Site ID is missing from session data on fresh install/first login

Hi, I am a total newbie to centos 8/linux and openemr. I managed to install centos 8 (1911) with latest updates and LAMP (php 7.2.24, mariadb 10.3.17-1, httpd 2.4.37). After that I manage to setup openemr 5.0.2 (3) sucessfully up to login screen. On first login, I encountered the “site ID is missing from session data” and don’t know how to proceed.

I did notice some error from www-error.log saying
“[24-Jun-2020 13:16:41 UTC] PHP Warning: session_start(): Failed to read session data: files (path: /var/lib/php/session) in /var/www/html/openemr/src/Common/Session/SessionUtil.php on line 78”. I don’t know what it means.

My SessionUtil.php from line 53 to 79 is as below:

public static function coreSessionStart($web_root)
{
if (version_compare(phpversion(), ‘7.3.0’, ‘>=’)) {
session_start([
‘cookie_samesite’ => “Strict”,
‘name’=> ‘OpenEMR’,
‘cookie_httponly’ => false,
‘cookie_path’ => $web_root ? $web_root : ‘/’,
‘gc_maxlifetime’ => self::$gc_maxlifetime,
‘sid_bits_per_character’ => self::$sid_bits_per_character,
‘sid_length’ => self::$sid_length,
‘use_strict_mode’ => self::$use_strict_mode,
‘use_cookies’ => self::$use_cookies,
‘use_only_cookies’ => self::$use_only_cookies
]);
} else {
session_start([
‘name’ => ‘OpenEMR’,
‘cookie_httponly’ => false,
‘cookie_path’ => $web_root ? $web_root : ‘/’,
‘gc_maxlifetime’ => self::$gc_maxlifetime,
‘sid_bits_per_character’ => self::$sid_bits_per_character,
‘sid_length’ => self::$sid_length,
‘use_strict_mode’ => self::$use_strict_mode,
‘use_cookies’ => self::$use_cookies,
‘use_only_cookies’ => self::$use_only_cookies
]);
I have read some other threads with similar title but don’t quite understand like proper credentials in sqlconfig.php etc.
Please help me to proceed from here.
Thanks in advance.

Hi @isurgeon ,
I think this issues with centos has been reported before and has to do with php not having permission to write to drive (php has to be able to write to drive to store/maintain sessions).
Help Needed for Centos 8 OpenEmr setup_statr, session

Hi. Thanks for the link.
I read through and checked my selinux via status said it is permissive but when I checked the config file it is disable. I supposed it is disabled then.

I installed the mod_ssl but cannot enable it as suggested by some website like this:
" How to configure the Apache mod_ssl module

  1. Open the mod_ssl Apache configuration file located at /etc/httpd/conf.d/ssl.conf
  2. Enable name-based virtual hosting on port 443
  3. Add the following text just before the SSL Virtual Host Context comment
    # Use name-base virtual hosting
    NameVirtualHost *:443
  4. Disable the default https host
  5. Comment out all text following the SSL Virtual Host Context comment"
    Restarting httpd failed when I changed the ssl.conf.
    After installing mod_ssl, I also don’t have the ssl-params.conf file to configure as per Luis suggestion.

From your comment, which folders should I be giving permission to php to write to? 660 or 777?
I am thinking to change to Ubuntu if my problem cannot be solved.
Thanks btw.