Description
Symfony version(s) affected: 4.3.3
Description
The following error exception now occurs after we updated from 4.3.2 to 4.3.3:
Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13)
How to reproduce
Reload application page. Error occurs 3 out of 4 reloads.
I have traced cause down to change of Dependency Injection in framework-bundle ./vendor/symfony/framework-bundle/DependencyInjection/Configuration.php file.
Version 4.3.2 line 553:
->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
Version 4.3.3 line 556:
->scalarNode('save_path')->end()
Possible Solution
Replace Version 4.3.3 line 556 with code that provides defaultValue for save_path from Version 4.3.2 line 553. Problem goes away.
Additional context
I can also correct issue if I chown /var/lib/php/sessions
from root to Apache owner. I do not see this as viable solution, because that would require changing 20+ web servers which could be overwritten by next PHP update.
Kind regards,
Dave Spiegel