Forums | Mahara Community

Support /
Problem with sessions when installing (PHP version problem?)


01 August 2019, 11:15

Hello,

I'm trying to install Mahara inside docker containers, which I'm very sure are configured correctly.

Initially, I was having problems during installation. The log was reporting error like:

... "Undefined index: messages", "/var/www/html/auth/session.php", 450" ...

Looking at the forum I could tell that there was a problem with PHP versions: around how the sessions were managed. This prompted my to double check the version of PHP I was running and sure enough it was version 7.2. I reconfigured my PHP container to be version 7.0.33 and rebuilt my system...

But then I got a web output stating :
Warning: session_write_close(): Session data file is not created by your uid in /var/www/html/auth/session.php on line 520
Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (3;/var/www/mahara_data/sessions) in /var/www/html/auth/session.php on line 520

So it seems that I still have problem with sessions with PHP version 7.0.x

Any suggestions? Happy to provide more information about the setup I've configured.

Thanks,

Guillaume

Robert Lyon's profile picture
Posts: 756

01 August 2019, 12:41

Hello Guillaume,

Looking at that error "session.save_path is correct (3;/var/www/mahara_data/sessions) " it sounds like there is a problem writing to sessions directory

Have you read / tried the info under "Unable to login after upgrade"?

https://wiki.mahara.org/wiki/System_Administrator%27s_Guide/Upgrading_Mahara#Q:_Unable_to_login_after_upgrade

Cheers

Robert

01 August 2019, 18:20

Hi Robert,

 

I had seen other forum posts where you talked about the difference between PHP version on how it managed the 'sessions' directory, consequently I have been doing installation with a empty 'mahara_data' directory when debugging with issue.

I had noticed that PHP 7.0.* seem to create less files in 'sessions' (i.e. deleting the directory was much quicker), so I just did a quick test.

With PHP 7.0.33, sessions contains 4,368 subfolders (and 2 files)
With PHP 7.2.20, session contains 33,824 subfolders (and 919 files)

Anyway, I guess this is academic since I should stick to PHP 7.0.x

Thanks,

Guillaume

 

01 August 2019, 19:08

Hello again Robert,

I have finally found my problem which was to do with shared volumes with my docker containers.

I'd set up Mahara using three containers; (1) HTTPd, (2) PHP, (3) POSTGRES.

So that the Mahara htdocs was available to both HTTPd and PHP containers I created an external 'volume' which both containers pointed to. This has a dual benefit of not having to copy to files locally in each containers, and having the possibility of modifying the file in htdocs have having served up by either container automatically.

I did the same for "maraha_data", thinking that both the HTTPd and PHP containers would need access to it. And that's where all my problems came from. I guess PHP has issues with the sessions directory being stored in an external volume (though on the OS it looks like a normal directory). So I tried creating the 'maraha_data' directory locally in the PHP container and it all installed smoothly.

Only problem will be if the HTTPd server needs to serve up files from this directory which isn't replicated in its container. But I think that's not going to happen.

Thank you for your earlier response, and thank to Tobias for helping me also. I'll post my docker setup files on my Mahara page when I've tidied my project up and written up the documentation.

Have a nice day,

Guillaume

 

4 results