SessionHandler::gc(): ps_files_cleanup_dir | Permission denied (13)

走远了吗. 提交于 2019-12-23 12:08:25

问题


i have a problem with PHP7 in CentoOS (WHM/CPANEL) and Prestashop 1.7

the system gives me this messagges:

Notice on line 429 in file /home/onywf3fr9a/public_html/app/cache/dev/classes.php

[8] SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/cpanel/php/sessions/ea-php70) failed: Permission denied (13)


回答1:


I have the same issue, I changed the session.save_path to "/tmp" in my php.ini




回答2:


For fixing the

«Notice: SessionHandler::gc(): ps_files_cleanup_dir: opendir("/var/cpanel/php/sessions/ea-php70") failed: Permission denied"

I recommend to grant the write access rights for this particular folder (/var/cpanel/php/sessions/ea-php70) to the operating system account you use for the PHP interpreter.

Disabling the PHP's session garbage collector with the session.gc_probability=0 PHP setting is not a good solution, because you will have a lot of orphaned session files in the session folder, and it will waste the disk space and slow down your server.




回答3:


I cleared cache and problem has been solved :)




回答4:


This error occurs, because you need folder permission to store your session files in the session folder.

This error is common for all popular frameworks. Solution is 1. Give permission to the session folder as showing to store files OR 2. create a local session folder in your project and rewrite the session files storing path in your project.



来源:https://stackoverflow.com/questions/47043351/sessionhandlergc-ps-files-cleanup-dir-permission-denied-13

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!