Getting phpMyAdmin to work with MemCached

October 27th, 2009

phpMyAdmin-error

I just spent a few hours trying to figure out why phpMyAdmin was throwing this error:

phpMyAdmin – Error
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

I eventually discovered it had something to do with php sessions. When looking at php.ini I noticed references to memcached:

/etc/php.ini:

session.save_handler = memcache
session.save_path = "tcp://192.168.100.242:11211?persistent=1&weight;=1&timeout;=1&retry;_interval=15"

A few searches on google revealed it to be a problem with the way phpmyadmin handles php sessions. By adding the following two lines of code to libraries/session.inc.php I was able to get phpmyadmin up and running.

phpmyadmin/libraries/session.inc.php:

// See bug #1538132. This would block normal behavior on a cluster
ini_set('session.save_handler', 'files');
ini_set('session.save_path' , "/var/lib/php/session");

What do you have to say?