folder “ea-php55” deleted, now session doesn't

2019-09-13 19:46发布

问题:

recently a huge size increase happend in a folder in cPanel host in this address:

.cagefs/var/cpanel/php/sessions/ea-php55

it was about 700MB size. I couldn't even open this folder to see all files. so I deleted the entire folder and recreated it. I also set Permissions to 0700 (like it was before).

now session doesn't work. I can't even login to my website's admin panel. How can I fix this problem?

回答1:

Before it could have been with permission 0700 but the owner should be different - something like http or www. In case you can't change its owner to the proper one, you could change the permissions to 0777. Not the best solution, because it security risky, but it will work for a start.



回答2:

After 2 days finally solved the problem. I created a folder named "session" near public_html.

/public_html
/session

and added one line of php code to change the "session save path" to that folder :

ini_set('session.save_path',realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../session'));

now session is working. I don't think this is a perfect way but at least it's working now.

if you see this and have a better way please write your answer.



回答3:

I just solved my similar problem by setting the session path to:

/var/cpanel/php/sessions/ea-php55 

instead of this (even if I use php 5.4):

/var/cpanel/php/sessions/ea-php54 

So in your case it should work with this:

/var/cpanel/php/sessions/ea-php56 

instead of

/var/cpanel/php/sessions/ea-php55

even if you use php 5.5 and assuming you have php 5.6 installed.