CyberPanel Community

PHP garbage collector lacking permission - [STDERR] PHP Notice: session_start(): ps_files_cleanup_d

ma
mak #1

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.

22 replies
us
usmannasir #2

Can you tell me your OS?

ma
mak #3

Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-88-generic x86_64)

us
usmannasir #4

root@cyberpanel-backup-test:/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
root@cyberpanel-backup-test:/var/lib/lsphp/session#

Permission for your session folders look like this ?

us
usmannasir #6

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.

us
usmannasir #8

try

chown -R nobody:nogroup /var/lib/php/sessions

qt
qtwrk #10

do you have example PHP script to test this ? or I just need to do a session_start() ?

ma
mak #11

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.

qt
qtwrk #12

emmmmm , just set up ubuntu 20 + ols + lsphp80 , and with example #1 code from PHP: session_start - Manual

still can’t see the error

did i miss any step to reproduce it ?

ma
mak #13

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.

ma
mak #14

@usmannasir still experiencing issues with this. do you have any ideas? it was happening on my second website too before me making any changes

ma
mak #16

@usmannasir hey I’m still experiencing issues with this, do you have any ideas?

NK
Nitesh Kunnath #17

Have you tried replicating this same issue in another server setup? Please let me know if its fixed already.

ma
mak #18

Yes I have. I have two VPS’ with Ubuntu 20.04. The first one I had to delete the session file directory because it was too filled, and I only could see the permissions error after I increased the garbage collector divisor and probability. The second one I could see the permissions error right away before changing any permissions like usmansir. And yes this is still occuring, hopefully there’s a fix to this so I can continue to use cyberpanel

ma
mak #19

What I’m trying to say is that I didn’t modify permissions on the second VPS until usmansir told me to. And still, it wasn’t working before changing permissions either. The folders were at first left alone and nothing was modified, and the garbage collector was still unable to cleanup expired sessions.

NK
Nitesh Kunnath #20

I will have a check and revert soon.

ma
mak #21

Thank you, looking forward to what you find. I’m still expirencing this error.

NK
Nitesh Kunnath #22

Sorry I didnt get time to check the same as was busy with family.
Will test soon.

sv
svenms #23

Hi @mak , did you resolve the problem? I have the last version of Cybepanel and Ubuntu 20.04.4 and still getting the same problem.
This problem has been persistent at least from version 2.0.0 and in my case is generated when a plugin tries to access ps_files_cleanup_dir.

PHP Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/lsphp/session/lsphp74) failed: Permission denied (13) in /home/abc.cl/public_html/wp-content/plugins/transbank-webpay-plus-rest/webpay-rest.php on line 82

ma
mak #24

Sadly not. I realized there wasn’t much benefits to using Cyberpanel in my scenario at least. I’m now using Nginx, this guide is very easy to follow How To Install Linux, Nginx, MySQL, PHP (LEMP) stack On CentOS 7 | DigitalOcean

Make sure you do sudo chown -R root:nginx /var/lib/php/session/ after completing the tutorial. I’ve been running this configuration for several months now and I’ve had no issues :+1:

sv
svenms #25

Thank you for your response Mak.
Hello @die2mrw007 , would you recommend us any other configuration to fix this? Shouldn’t this problem come resolved by default after Cyberpanel installation?

Thank you very much in advance!

ma
mak #26

It should, but it doesn’t seem it is. You could try another server OS perhaps. CentOS7 is quite solid. If it still has this issue on CentOS7, then you should likely use another software. Anything nginx related is better, nginx has the best resilience to DDoS attacks and high use.

NK
Nitesh Kunnath #27

Nginx is better is debatable and its all a personal choice afterall. I prefer Litespeed and Openlitespeed more than Nginx and Apache2 stack for its reliability, better performance, ease of use, full apache support which is widely used.

Nginx fails at large ecommerce sites. Nginx still doesn’t have support for HTTP3 QUIC protocol. Many useful features which otherwise are available in other web technology is behind paywall named Nginx Plus. A lot other negative aspects are there.

I am not saying Nginx is completely bad, but I will prefer it only if Litespeed/openlitespeed is not available for any reason my next immediate alternative choice would be Nginx itself.

Also, regarding this particular issue how can I reproduce the same in my test server? I will check it today.

Sign in to reply