Koozali.org: home of the SME Server

php-fpm session.save_handler

Offline Gary Douglas

  • *
  • 68
  • +1/-0
php-fpm session.save_handler
« on: January 11, 2023, 09:34:49 AM »
SME10 appears to have a single template for setting php session.save_handler in /etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays
I have a webserver with 4 drupal7 websites which require php_admin_value[session.save_handler] = user
Setting a custom template for session.save_handler = user upsets nextcloud 24 on php74, requires manual edit /etc/opt/remi/php74/php-fpm.d/ibays.conf = files
It doesn't survive a reconfigure but solution is manageable, website developers can't resolve their app.
May be something I am doing wrong, it's all ok for now.
« Last Edit: January 11, 2023, 09:57:30 AM by Gary Douglas »

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: php-fpm session.save_handler
« Reply #1 on: January 11, 2023, 10:47:20 PM »
Quote

Setting a custom template for session.save_handler = user upsets nextcloud 24 on php74

yes as this will take precendence on all php-fpm pools using php74 that do not set it. 

options you have :
- try using Use of session_set_save_handler() at beginning of your app or in config file. might be too late in the execution. 
ref https://stackoverflow.com/questions/55785829/unable-to-set-session-save-handler-in-my-code/57049215#57049215

- template-custom of the ibay template, and adding this while making  it conditional for this ibay and php version not to polute other version and ibays. I strongly advise against a template-custom of this critical fragment as you might loose further update which might be security sensitive.


- fill a bug to add this value as a property

- fill a bug to allow parsing of a subdirectory where one can drop something to add.

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: php-fpm session.save_handler
« Reply #2 on: January 12, 2023, 12:44:48 AM »
Hmm. Tried that as an experiment and got lots of these as a reward.

Code: [Select]
PHP Recoverable fatal error:  Unknown: Cannot set 'user' save handler by ini_set() or session_module_name() in Unknown on line 0
Not sure this is the right way to do it now either, but blowed if I know what is.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: php-fpm session.save_handler
« Reply #3 on: January 12, 2023, 06:15:30 AM »

Offline Gary Douglas

  • *
  • 68
  • +1/-0
Re: php-fpm session.save_handler
« Reply #4 on: January 12, 2023, 09:43:29 AM »
at the time I did try custom template of the ibay settings, will look at this again outside busy hours and try a bit harder. The issue was found when server was upgraded from sme9 to sme10.

The web developers advice was;  Drupal requires session.save_handler set as 'user'.
Drupal can work with globally setting session.save_handler to files, as it alters some settings per its needs on run.
But here, as it is set as admin_value, the PHP interpreter considers it a hard bound setting and doesn't allow altering on run.

websites are to be updated so things might change. They also said the following;

Right now we are running Drupal on PHP 5.5 and working on some improvements on sites. We will switch to PHP 7.4 while upgrading Drupal, once done with the urgent improvements being done to make the existing sites work as needed.
Right now we aren't using any PHP 7.4 versions, so we can keep its session.save_handler setting as 'files' to keep low server load.

It was the pending update for nextcloud24+ to php81 made me think to mention this. I can apply the same mod to php81 and they can use php74 =user


« Last Edit: January 12, 2023, 09:52:01 AM by Gary Douglas »

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: php-fpm session.save_handler
« Reply #5 on: January 12, 2023, 12:48:10 PM »
forgot it was hard set in file. 

so yes you have to open a bug to have it modified and have a dedicated  property per ibay

Offline Gary Douglas

  • *
  • 68
  • +1/-0
Re: php-fpm session.save_handler
« Reply #6 on: January 13, 2023, 10:39:40 AM »
looks like a lot of work if no-one else has the issue. If this post helps someone else that's good. If you prefer a bug raised please say and I can test the change. 
« Last Edit: January 13, 2023, 11:06:03 AM by Gary Douglas »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: php-fpm session.save_handler
« Reply #7 on: January 13, 2023, 12:22:19 PM »
looks like a lot of work if no-one else has the issue. If this post helps someone else that's good. If you prefer a bug raised please say and I can test the change.

There a multitude of PHP settings (regrettably) and we should be able to set them according to needs.

JP has a bug on this so worth following.

https://bugs.koozali.org/show_bug.cgi?id=12302
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: php-fpm session.save_handler
« Reply #8 on: January 13, 2023, 01:01:52 PM »
the bug 12302 is to allow admin to set any not already defined php setting.  This solution do not allow to change something already set without error from php-fpm.

the real need here is to be able to change a hard coded option. so needs a different bug.  This is a lot less work than bug 12302 and could be released faster with easier and faster testing. so yes need a bug, and this is better done by the Original reporter. thanks.

Offline Gary Douglas

  • *
  • 68
  • +1/-0
Re: php-fpm session.save_handler
« Reply #9 on: January 13, 2023, 05:47:05 PM »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: php-fpm session.save_handler
« Reply #10 on: January 17, 2023, 06:34:13 PM »
thank you, Bug raised; https://bugs.koozali.org/show_bug.cgi?id=12303

Just for ref I have been messing about on this one which is the same as 12303 I think. Patch I made to help myself while testing.

https://bugs.koozali.org/show_bug.cgi?id=12301
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: php-fpm session.save_handler
« Reply #11 on: February 05, 2023, 05:37:45 AM »
should be fixed with smeserver-php-3_0_0-45_el7_sme

Offline Gary Douglas

  • *
  • 68
  • +1/-0
Re: php-fpm session.save_handler
« Reply #12 on: February 06, 2023, 07:27:47 AM »
might be next weekend before I can try this on the production server

Offline Gary Douglas

  • *
  • 68
  • +1/-0
Re: php-fpm session.save_handler
« Reply #13 on: February 12, 2023, 10:51:05 AM »
I can confirm update smeserver-php-3.0.0-45.el7.sme.x86_64 has resolved this issue on the single production server I have which PHP55 drupal sites user logins were affected. Also installed on an unaffected server and no issues noticed. Bug 12303 updated.