• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Default Owner of /var/lib/php

Izaim

Basic Pleskian
Hi,

What are the defualt permission and owner for directory '/var/lib/php/sessions'.

I get this error:
The session save path '/var/lib/php/sessions' is not writable.

URL: http://ads.almakos.com/www/admin/install.php

Since I upgraded to Onyx and Ubuntu 16, the default dir owner of 'var/lib/php' was root : root. I changed to www-data : psacln but I am getting the same error.
 
Hi Izaim O.,

What are the defualt permission and owner for directory '/var/lib/php/sessions'.
The correct permissions are:

drwx-wx-wt ( => 1733 ) root root

I changed to www-data : psacln
What makes you think, that these are the correct permissions?


Pls. post the output of the following commands from your command line:
Code:
stat /var/lib/php/sessions

find /etc/php -type f -name "php.ini" -exec grep --color -Hni "session.save_path"  {} \; | grep --color -Hni /var/lib/php
find /etc/php5 -type f -name "php.ini" -exec grep --color -Hni "session.save_path"  {} \; | grep --color -Hni /var/lib/php

find /opt/plesk -type f -name "php.ini" -exec grep --color -Hni "session.save_path"  {} \; | grep --color -Hni /var/lib/php
 
Hi Izaim O.,


The correct permissions are:

drwx-wx-wt ( => 1733 ) root root


What makes you think, that these are the correct permissions?


Pls. post the output of the following commands from your command line:
Code:
stat /var/lib/php/sessions

find /etc/php -type f -name "php.ini" -exec grep --color -Hni "session.save_path"  {} \; | grep --color -Hni /var/lib/php
find /etc/php5 -type f -name "php.ini" -exec grep --color -Hni "session.save_path"  {} \; | grep --color -Hni /var/lib/php

find /opt/plesk -type f -name "php.ini" -exec grep --color -Hni "session.save_path"  {} \; | grep --color -Hni /var/lib/php

stat /var/lib/php/sessions
File: '/var/lib/php/sessions'
Size: 1921024 Blocks: 3760 IO Block: 4096 directory
Device: 902h/2306d Inode: 63442989 Links: 2
Access: (7733/drws-ws-wt) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2016-12-08 01:14:00.976597900 +0100
Modify: 2016-12-08 01:14:14.000642343 +0100
Change: 2016-12-08 01:14:14.000642343 +0100
Birth: -

find /etc/php -type f -name "php.ini" -exec grep --color -Hni "session.save_path" {} \; | grep --color -Hni /var/lib/php
(standard input):3:/etc/php/7.0/cgi/php.ini:1306:;session.save_path = "/var/lib/php/sessions"
(standard input):7:/etc/php/7.0/fpm/php.ini:1306:;session.save_path = "/var/lib/php/sessions"
(standard input):11:/etc/php/7.0/cli/php.ini:1306:;session.save_path = "/var/lib/php/sessions"
(standard input):15:/etc/php/7.0/apache2/php.ini:1306:;session.save_path = "/var/lib/php/sessions"

NO PHP5 DIR, I DONT USE PHP5.

find /opt/plesk -type f -name "php.ini" -exec grep --color -Hni "session.save_path" {} \; | grep --color -Hni /var/lib/php
(standard input):3:/opt/plesk/php/7.0/etc/php.ini:1318:session.save_path = "/var/lib/php/sessions"
 
Hi Izaim O.,

Access: (7733/drws-ws-wt) Uid: ( 0/ root) Gid: ( 0/ root)
Pls. see again:
The correct permissions are:

drwx-wx-wt ( => 1733 ) root root
You have set:
drws-ws-wt ( => 7733 ) root root

;)

Consider as well to uncomment:
(standard input):15:/etc/php/7.0/apache2/php.ini:1306:;session.save_path = "/var/lib/php/sessions"
... to avoid possible issues with the "old" - standard Ubuntu path "/var/lib/php5".
 
Last edited by a moderator:
Hi Izaim O.,


Pls. see again:

You have set:
drws-ws-wt ( => 7733 ) root root

;)

Consider as well to uncomment:

... to avoid possible issues with the "old" - standard Ubuntu path "/var/lib/php5".


Dear,
I ran the command "sudo chmod -R 1733 /var/lib/php/" several times but the permissions are still the same. 7733.

Chmod not working .. It is not changing the first numer from 7 to 1.
 
Hi Izaim O.,

first of off, you should consider to change ONLY the permissions for the depending folder ( /var/lib/php/sessions ) and not for the whole recursive folder and files under "/var/lib/php".... :rolleyes:

Second, if the directory file size is LARGER than 1 MB, you have to recreate that folder:

Check the directory size over your command line ( logged in as user "root" ):
Code:
du -h /var/lib/php/session

Remove and re-create the folder ( logged in as user "root" ):
Code:
rm -rf /var/lib/php/session
mkdir /var/lib/php/session
chmod 1733 /var/lib/php/session/
 
Back
Top