Session Error on php 7.2

Error: session_start(): ps_files_cleanup_dir: opendir(/tmp) failed: Permission denied (13) in /kunden/example.com/….

I came upon this error while i upgraded my php version to 7.2 from 7.1. We are hosted to Domainfactory and it actually was something new for me. I just search the internet a little bit and found two interesting articles.

The first link (in  german ) was from Domain factory directly. Domainfactory said that the error was created because the directory /tmp is secured and you cannot delete files if you haven’t created thyself. Noted that the session files are created by the server and not from my scripts i could not delete them. Domainfactory deletes automatically the /tmp directory every three days.

The second link actually offered me a solution. You can let php know that the sessions should not be deleted by it. But they will be deleted automatically otherwise. This can man very easily do if he sets the php.ini value session.gc_probability = 0. Which actually does what it implies. The probability for the garbage collector to collects garbage is zero!

Problem solved!

You may also like...