phpwindowsiispermissionsfastcgi

Windows 2019 and PHP 7.3: "session_start(): ps_files_cleanup_dir: opendir failed: No such file or directory (2)"


Having this problem. I know there is similar questions, but none of them provided a solution.

Error message:

PHP Fatal error: Uncaught ErrorException: session_start(): ps_files_cleanup_dir: opendir(D:\TempPHP) failed: No such file or directory (2).

Some relevant php.ini settings:

session.gc_probability = 1
error_log = "D:\TempPHP\PHP73x64_errors.log"
upload_tmp_dir = "D:\TempPHP\upload"
session.save_path = "D:\TempPHP"
sys_temp_dir = "D:\TempPHP"

edit: "D:\" is a local partition. Not a mapped or a shared drive. Logs and sessions are being written successfully. It seems that php just can't remove those files.


Solution

  • Ok, found out the problem.

    Seems like that with windows the session.save_path cannot be in a different disk / partition from the PHP executable path. In my case PHP directory was c:\Program Files\PHP\v7.3, so I moved the TempPHP folder from D: to C: partition and changed the value of session.save_path from "D:\TempPHP" to "C:\TempPHP". Now the sess_xxxxx files are automatically cleaned up and there is no more error messages.

    Don't know if this holds true for others php or windows versions.