Reputation: 119
I've updated Phpmyadmin from 4.4.1 version to 4.4.2 version and started to get this error:
Warning in ./libraries/session.inc.php#101 session_start(): open(/var/lib/php/session/sess_bsv20h8gq58qq1ep33qbfrb7r62jtksi, O_RDWR) failed: Permission denied (13)
Backtrace
./libraries/session.inc.php#101: session_start() ./libraries/common.inc.php#349: require(./libraries/session.inc.php) ./index.php#12: require_once(./libraries/common.inc.php)
This happened on two different machines with Centos 6.6 installed. The serber have Apache 2.2, PHP 5.4 and Nginx as reverse proxy.
Upvotes: 11
Views: 45213
Reputation: 610
Similar to the solution postged by zigojacko, for PHP 7.1 I needed the following command:
chown nginx:nginx /var/lib/php/7.1/session
On Amazon Linux EC2 instance running Nginx.
Upvotes: 0
Reputation: 325
Phpmyadmin provide config for this case.
$cfg['SessionSavePath'] = '/tmp';
phpmyadmin/doc/config.rst
config:option:: $cfg['SessionSavePath']
:type: string
:default: ``''``
Path for storing session data (`session\_save\_path PHP parameter
<https://secure.php.net/session_save_path>`_).
warning::
This folder should not be publicly accessible through the webserver,
otherwise you risk leaking private data from your session.
Upvotes: 4
Reputation: 2131
Be sure to check your php.ini file, specifically the "session" section.
; The file storage module creates files using mode 600 by default.
; You can change that by using
;
; session.save_path = "N;MODE;/path"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
; http://php.net/session.save-path
session.save_path = "/var/lib/php/sessions"
If your using memcache you would probably have something like the following:
session.save_path = '127.0.0.1:11211'
By default it should look be a line like the following:
session.save_path = "/var/lib/php/sessions"
When copying a php.ini config from one server to another I ran into this issue where the other server was not using memcache for sessions.
Upvotes: 0
Reputation: 303
I know that this is a very old question, but I resolve the problema just with this line:
chmod 777 to /var/lib/php/session
My server details, CentOS 6, provider vultr.com
Upvotes: 16
Reputation: 2063
In my case, I was running nginx primarily so needed to chown the sessions directory to nginx for user and group... (By default, the session folder was in the apache group).
chown nginx:nginx /var/lib/php/session
Then force refresh the phpMyAdmin page and the session permission related errors are resolved.
And if existing sessions, the contents too:-
chown -R nginx:nginx /var/lib/php/session
Upvotes: 41
Reputation: 7803
I recently had same issue on phpMyAdmin 4.4.3 cased by SELinux.
First of all check if you fit to server requirements http://docs.phpmyadmin.net/en/latest/require.html
Second, allow SELinux use PHP session:
grep php /var/log/audit/audit.log | audit2allow -M mypol
semodule -i mypol.pp
and change PHP session.save_path
permissions to root:root
:
chown -R root:root /var/lib/php/session
chown -R root:root /var/lib/php/wsdlcache
Upvotes: 0