Koozali.org: home of the SME Server

configure PHP session.gc_maxlifetime value per iBay

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
configure PHP session.gc_maxlifetime value per iBay
« on: September 19, 2018, 06:26:51 PM »
We have several iBays running on PHP 7.1, using the software collections contrib, and two of them need to have a much larger timeout value to serve the users properly.

I am wondering whether this can be adjusted using the templates, db config, or some other method. Any and all suggestions are most welcome.

[EDIT] corrected parameter name from "gc_timeout" to "gc_maxlifetime"
« Last Edit: September 19, 2018, 06:33:14 PM by Mophilly »
- Mark

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: configure PHP session.gc_maxlifetime value per iBay
« Reply #1 on: September 20, 2018, 12:40:21 AM »
Yes you can but I can't remember where the php.ini files are for 7.1

Have a search for php.ini and you'll find the right path in /etc/e-smith/templates

I'll look tomorrow if you can't find them.
...
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 Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
Re: configure PHP session.gc_maxlifetime value per iBay
« Reply #2 on: September 20, 2018, 02:27:30 AM »
That would be great if you have time. We looked through PHP docs, and I found templates for php.ini for global change. So the next bit is whether the value can be set in the config of specific PHP app (iBay).
- Mark

Offline michelandre

  • *
  • 261
  • +0/-0
Re: configure PHP session.gc_maxlifetime value per iBay
« Reply #3 on: September 20, 2018, 04:40:53 AM »
Hi Mophilly,

Here is what i use for my PHP-71. I do nothing else.


Code: [Select]
# config setprop php71 MemoryLimit 256M

# config setprop php71 UploadMaxFilesize 50M

# config setprop php71 PostMaxSize 52M

# signal-event php-update

# config show php71

php71=configuration
    AllowUrlFopen=Off
    MaxExecutionTime=30
    MaxFileUpload=20
    MaxInputTime=60
    MemoryLimit=256M
    PhpModule=disabled
    PostMaxSize=52M
    UploadMaxFilesize=50M


The only restriction I have for memory usage is: MemoryLimit (256M) > PostMaxSize (52M) > UploadMaxFilesize (50M).
I know it is working because in WordPress I see my limit instead of the default one of 10M.

I guess you can adjust MaxExecutionTime the same way.
I do not know for execution time: maybe it is related also to MaxInputTime.


Michel-André



« Last Edit: September 20, 2018, 04:50:07 AM by michelandre »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: configure PHP session.gc_maxlifetime value per iBay
« Reply #4 on: September 20, 2018, 12:08:06 PM »
Hmmm. Having looked I am not sure if you can set those values per ibay, only for whatever version of PHP is being used. So you can set it for say PHP7.1 and that will either apply to any ibay using PHP7.1, or the whole server if used.

/etc/e-smith/templates/opt/remi/php71/root/etc/php.ini/80ModuleSettings16Session

That is a hardwired value, not from the config db, so you need to either amend the template or duplicate it to  a custom template and change it there

The only way to get around that per ibay is probably to modify it with .htaccess values

You need to allow overrides:

https://wiki.contribs.org/Useful_Commands#Enable_AllowOverride_All.2FNone
...
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