Since last php update ive trouble on some sites.
Problem: permission denied for sessions
Ive seen sessions are written to /var/lib/php/session.
Now, to solve this problem i chmod 777 this folder.
Is this a safe solution?
PHP session folder chmod
Re: PHP session folder chmod
No, it's not.
If you are running PHP applications under their own user (e.g. under FastCGI in stead of Apache/mod_php), you should define them their own session.save_path.
If you are running PHP applications under their own user (e.g. under FastCGI in stead of Apache/mod_php), you should define them their own session.save_path.
Lemonbit Internet Dedicated Server Management
Re: PHP session folder chmod
Thanks, your post was very helpful to me.
Ive changed the original sessions folder to 0770 and use session.save_path like you suggest, its working fine.
Ive changed the original sessions folder to 0770 and use session.save_path like you suggest, its working fine.
Re: PHP session folder chmod
If you don't wish to define a separate session save folder for each domain, you can set the permissions as follows:
chmod 733 /var/lib/php/session
chmod +t /var/lib/php/session
+t sets the sticky bit for the directory such that when the sticky bit is set, only the item’s owner, the directory’s owner, or the superuser can rename or delete files.
chmod 733 /var/lib/php/session
chmod +t /var/lib/php/session
+t sets the sticky bit for the directory such that when the sticky bit is set, only the item’s owner, the directory’s owner, or the superuser can rename or delete files.