• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

[PPPM-2714] Error in sessions.save_path for multiple PHP versions

Thomas Poisl

Basic Pleskian
A really nice feature has been brought to plesk with the native support for multiple PHP versions now.

I treid it out, but there seems to be an error in the session.save_path of PHP 5.5.23 (the one I tested).

sessions.save_path points to /var/lib/php/sessions but the default before seems to be /var/lib/php/session so the folder does not exist.

For now I simply worked with a symlink to solve the problem:
cd /var/lib/php/
ln -s session sessions

Not sure if other PHP version or other OSes (besides PHP 5.5.23 and CentOS 6.6 are affected).
 
There seem to be more problems on the road...

I sporadically get 500 errors from typo3 sites I am accessing with the plesk php 5.5.23 version.

In the logs I find again some clues to permission problems:
(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

For now I am going back to my own compiled php 5.5.22, maybe I'll have some time in the next days to dig further into this.
 
Hello Thomas,

Thank you for fast feedback!
We will fix the issue with session.save_path in one of the nearest updates. It will be changed to the path provided by vendor's PHP packages.

Regarding errors from typo3 sites - I was not able to reproduce it. Can you provide more details?
 
I had some more time, but unfortunately I still have the described "connection reset by peer" problems randomly when accessing typo3 pages with the plesk PHP 5.5.23 version.

My first idea was to compare the php.ini files to reveal differences, but it doesn't seem to bring light into this problem.

Code:
diff /opt/plesk/php/5.5/etc/php.ini /usr/local/php-5.5.22/etc/php.ini
86c86
< ; This is php.ini-production INI file.
---
> ; This is php.ini-development INI file.
449c449
< error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
---
> error_reporting = E_ALL
466c466
< display_errors = Off
---
> display_errors = On
477c477
< display_startup_errors = Off
---
> display_startup_errors = On
521c521
< track_errors = Off
---
> track_errors = On
746c746
< ;cgi.redirect_status_env =
---
> ;cgi.redirect_status_env =
910c910
< ;date.timezone =
---
> date.timezone = Europe/Berlin
1001c1001
< ;sendmail_path =
---
> sendmail_path = /usr/sbin/sendmail -t -i
1215c1215
< mysqlnd.collect_memory_statistics = Off
---
> mysqlnd.collect_memory_statistics = On
1387c1387
< session.save_path = "/var/lib/php/sessions"
---
> ;session.save_path = "/tmp"
1449c1449
< session.gc_probability = 0
---
> session.gc_probability = 1

Since you have not been able to reproduce this problem so far, feel free to ask me for information that'll help you with this.

Typo3 Version I'm using is 6.2.10 LTS, on a simple page you have to click on 5-6 pages to make this problem appear.

Maybe it is a memory issue or the php coming with plesk is very likely compiled with other parameters.
 
There seem to be more problems on the road...

I sporadically get 500 errors from typo3 sites I am accessing with the plesk php 5.5.23 version.

In the logs I find again some clues to permission problems:
(104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server

For now I am going back to my own compiled php 5.5.22, maybe I'll have some time in the next days to dig further into this.

This might not be a php error. I had faults to with the php fast-cgi (from atomic) and it turns out that the default setup is rather unrealistic.

/etc/httpd/conf.d/fcgid.conf needs to be changed. Here is what i changed, you might have to google a bit to find the best settings for your server.

out of the box:
FcgidIdleTimeout 300
FcgidProcessLifeTime 300
FcgidMaxProcesses 32
FcgidMaxProcessesPerClass 32
FcgidMinProcessesPerClass 0

i changed mine into this

##FcgidIdleTimeout default = 300
FcgidIdleTimeout 300

##FcgidProcessLifeTime default = 3600
# FcgidProcessLifeTime 300

##FcgidMaxProcesses default = 1000
# FcgidMaxProcesses 32

##FcgidMaxProcessesPerClass default = 100
# FcgidMaxProcessesPerClass 32
# FcgidMinProcessesPerClass 0

# is what was in it
## are the default and because both are in comment the default is now active. I placed it there as a reminder to myself what the actual value at this moment is.

In you case, it might be FcgidMaxProcesses that needs adjustment.

As for session.save_path and the other stuff. I changed the php.ini with that of our own. The plesk one also has configurations from the devil (mysql persistent connections), if there is 1 thing you dont want on a chared hosting with tig wordpresses it are persistent connections

hope this helps
regards
Jan
 
I have installed plesk update 43 today.

I changed session.save_path in /opt/plesk/php/5.5/etc/php.ini and removed the "s" and deleted my symlink mentioned above.

The random problems seem to be gone by doing so, but I'm not sure if the removed symlink or the updated plesk php package solved it.

Anyway, thank you for fixing the session.save_path!
 
I've been pleased too early, the problem just reappeared.

As Jan suggested I checked /etc/httpd/conf.d/fcgid.conf, but it seems the values in there are reasonable:

FcgidIdleTimeout 40
FcgidProcessLifeTime 30
FcgidMaxProcesses 20
FcgidMaxProcessesPerClass 8
FcgidMinProcessesPerClass 0

Maybe the persistent DB connections pose this problem.

I'll post the configuration parameters I used on my working php installation:

Code:
./configure '--prefix=/usr/local/php-5.5.22' '--with-config-file-path=/usr/local/php-5.5.22/etc' '--with-freetype-dir=/usr/local/php-5.5.22' '--with-png-dir=/usr/local/php-5.5.22' '--with-jpeg-dir=/usr/local/php-5.5.22' '--with-libxml-dir=/usr/local/php-5.5.22' '--with-pear=/usr/local/php-5.5.22/pear' '--with-config-file-scan-dir=/usr/local/php-5.5.22/php.d' '--with-libdir=lib64' '--cache-file=../config.cache' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-openssl' '--with-pspell' '--with-pcre-regex' '--with-zlib' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--with-unixODBC=/usr' '--enable-shmop' '--enable-calendar' '--without-sqlite3' '--enable-pcntl' '--with-imap' '--with-imap-ssl' '--enable-mbstring' '--enable-mbregex' '--with-gd' '--enable-bcmath' '--enable-zip' '--with-xmlrpc' '--with-ldap' '--with-ldap-sasl' '--with-mysql=/usr' '--with-mysqli' '--with-snmp' '--enable-soap' '--with-xsl' '--enable-xmlreader' '--enable-xmlwriter' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-pgsql' '--enable-intl' '--without-pdo-sqlite' '--enable-fastcgi'
 
FcgidMaxProcesses 20

this means that the fgid engine will be able to have 20 processes at a time, seems a little low to me.

http://www.cloudlinux.com/blog/clnews/perfecting-fastcgi-settings-for-shared-hosting.php

FcgidMaxProcesses -- this is the total number of processes FCGID will start, for all users. That is what will prevent OOM issues. The more RAM you have, the higher you can set the value.
If you set this value too low, you will get 500 errors, as FCGID will not be able to create new processes to serve requests.

Mine is at the default, being 1000.

persistent DB connections are made by the devil, always disable them. (in shared hosting that is)

regards
Jan
 
Back
Top