Hello,
I'm using cyberpanel with openlitespeed and I've been recieving this error
[STDERR] PHP Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/lsphp/session/lsphp80) failed: Permission denied (13) in /home/keyauth.com/public_html/dashboard/index.php on line 2
How do I fix it? I've looked at several solutions online and none of them have seemed to work so far.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Can you tell me your OS?
CyberPanel
Blog
Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-88-generic x86_64)
[email protected]:/var/lib/lsphp/session# ls -la
total 24
drwxr-xr-x 6 root root 4096 Nov 1 04:52 .
drwxr-xr-x 3 root root 4096 Nov 1 04:52 ..
drwx-wx-wt 2 root root 4096 Nov 1 04:52 lsphp72
drwx-wx-wt 2 root root 4096 Nov 3 10:13 lsphp73
drwx-wx-wt 2 root root 4096 Nov 1 04:52 lsphp74
drwx-wx-wt 2 root root 4096 Nov 1 04:52 lsphp80
[email protected]:/var/lib/lsphp/session#
Permission for your session folders look like this ?
CyberPanel
Blog
[email protected]:/var/lib/lsphp/session# ls -la
total 8604
drwxrwx-wt 6 root root 4096 Oct 31 11:29 .
drwxr-xr-x 3 root root 4096 Oct 7 18:02 ..
drwxrwx-wt 2 root root 4096 Oct 7 18:02 lsphp72
drwxrwx-wt 2 root root 4096 Oct 31 14:35 lsphp73
drwxrwx-wt 2 root root 4096 Oct 7 18:02 lsphp74
drwxrwx-wx 2 root root 8785920 Nov 4 15:56 lsphp80
looks like this. I'm guessing I messed up permissions when I deleted and recreated lsphp80 folder a little while ago when I had too many session files. I think I have resolved the root cause of that, by increasing garbage collector probability and divisor, so this looks to be the last step left to solve too many session files from happening again.
Please let me know what command I should do to resolve this, I am new to VPS hosting and don't want to mess anything up further. Appreciate you helping me with your software, thank you.
If your issue is resolved then its good, and it was definitely a permissions related issue. Anyways later if when I've more time I will record a video on how to fix such basic stuff.
CyberPanel
Blog
No it's actually not fixed yet. Initially the issue was I didn't have the garbage collector divisor and probablity low enough, now the issue is that the error below is output when the garbage collector is called.
PHP Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/lsphp/session/lsphp80) failed: Permission denied (13) in /home/restorecord.com/public_html/includes/functions.php on line 4
Also, I'm having this issue with my other site on a different VPS using Cyberpanel. I have not deleted the session folder on this server, and it's still having the same error when trying to cleanup session files as my other site is.
[email protected]:/var/lib/lsphp/session# ls -la
total 24848
drwxrwx-wt 6 root root 4096 Oct 16 20:08 .
drwxr-xr-x 3 root root 4096 Oct 16 20:08 ..
drwxrwx-wt 2 root root 4096 Oct 16 20:08 lsphp72
drwxrwx-wt 2 root root 4096 Nov 4 01:21 lsphp73
drwxrwx-wt 2 root root 4096 Oct 16 20:08 lsphp74
drwxrwx-wt 2 root root 25423872 Nov 5 18:40 lsphp80
Please let me know how to fix the error. Also, when I log into the server with FileZilla and right click the lsphp72, lsphp73, lsphp74, or lsphp80 folders in /var/lib/lsphp/session/, and then click file permissions, they all have the 773 permission. This was done by default, I didn't modify them to that myself.
I have zero reason to suspect issues occuring on this server too since I have not changed anything. On this server, I just installed cyberpanel and it's showing the same error as my other server.
try
CyberPanel
Blog
That did not work.
2021-11-06 13:36:22.668519 [NOTICE] [2026694] [172.70.82.44:31662-1#restorecord.com] [STDERR] PHP Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/lsphp/session/lsphp80) failed: Permission denied (13) in /home/restorecord.com/public_html/includes/functions.php on line 4
Also, I'm confused. My session files aren't in /var/lib/php/sessions, they're in /var/lib/lsphp/session/lsphp80. Not only does it say this in logs, I can see them there in FileZilla. The folder /var/lib/php/sessions is empty.
So, after the command you sent didn't work. I tried chown -R nobody:nogroup /var/lib/lsphp/session. That made it so I couldn't login. So, I deleted /var/lib/lsphp/session, created it again with FileZilla and created the lsphp80 folder and assigned it the 773 permission. After that I'm still getting the same error. Keep in mind until today, I had not modified the session folder and I was still getting this error with the default cyberpanel installed.
2021-11-06 14:07:03.399008 [NOTICE] [2026696] [172.70.82.226:55964#restorecord.com] [STDERR] PHP Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/lsphp/session/lsphp80) failed: Permission denied (13) in /home/restorecord.com/public_html/verify/index.php on line 5
Looking forward to your response. CyberPanel is great in all other aspects though if I keep having to clear out session files manually that will make it a huge deal breaker.
do you have example PHP script to test this ? or I just need to do a session_start() ?
Just need to do session_start(); it's the PHP garbage collector which runs depending on the probability and divisor. it's supposed to delete expired session files, though the above permissions error occurs. I have this one site where I did delete the session folder and recreated because it was using all the storage, though I also have another site which until today I hadn't modified the session folder, and it was still getting this error too. using the normal openlitespeed, not enterprise.
emmmmm , just set up ubuntu 20 + ols + lsphp80 , and with example #1 code from https://www.php.net/manual/en/function.session-start.php
still can't see the error
did i miss any step to reproduce it ?
maybe you don't have garbage collector set to run enough. I've set session.gc_probability = 5 and session.gc_divisor = 100, as it wasn't running enough before. Now it runs enough, but it gets that above-mentioned error.
@usmannasir still experiencing issues with this. do you have any ideas? it was happening on my second website too before me making any changes