I can't believe it's year 2020, php 7.4 is available, Contao 4.9.2, and I'm still fighting this error every once in a while!
Code:
[2020-05-02 20:49:37] request.CRITICAL: Uncaught PHP Exception ErrorException: "Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/tmp/phpfpmsessions/) failed: Permission denied (13)" at /www/htdocs/w0123456/someserver.com/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php line 101 {"exception":"[object] (ErrorException(code: 0): Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/tmp/phpfpmsessions/) failed: Permission denied (13) at /www/htdocs/w0123456/someserver.com/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php:101)"} []
Turns out, I already solved it once, 2 years ago, and I don't remember. I googled now and found this thread. I read it twice before realizing, that I already posted there at the time.
So, I'm posting here rather for my future self, when I will be looking for the solution next time (if the moderator allows – Hallo, Spooky!)
TL;DR
The session.gc_probability=0 in php.ini is indeed a correct setting, to disable PHP's native garbage collection, since many Linux systems have their own CRON job for this, which causes the conflict.
The problem is – Symfony doesn't respect your settings in php.ini, please read here: https://symfony.com/doc/4.4/componen...age-collection:
However, some operating systems (e.g. Debian) do their own session handling and set the session.gc_probability variable to 0 to stop PHP doing garbage collection.
That's why Symfony now overwrites this value to 1.
If you wish to use the original value set in your php.ini, add the following configuration:
Code:
# config/packages/framework.yaml
framework:
session:
gc_probability: null
For Contao, you can just put it in config.yml instead.
I have to add, my hoster is All-Inkl.
Bookmarks