phpmyadmin – Cannot start session without errors, please check errors

Unfortunately sometimes we get the problem with phpMyAdmin, here is the error from phpMyAdmin on ubuntu machine.

phpMyAdmin – Error

[code]
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.
[/code]

To find out where the session.save path
http://wiki.phpmyadmin.net/pma/session.save_path

run this script on your web server

[php]
<?php
// save as "session_test.php" inside your webspace
ini_set(‘display_errors’, ‘On’);
error_reporting(6143);

session_start();

$sessionSavePath = ini_get(‘session.save_path’);

echo ‘<br><div style="background:#def;padding:6px">’
, ‘If a session could be started successfully <b>you should’
, ‘ not see any Warning(s)</b>, otherwise check the path/folder’
, ‘ mentioned in the warning(s) for proper access rights.<hr>’;

if (empty($sessionSavePath)) {
echo ‘A "<b>session.save_path</b>" is currently’,
‘ <b>not</b> set.<br>Normally "<b>’;
if (isset($_ENV[‘TMP’])) {
echo $_ENV[‘TMP’], ‘</b>" ($_ENV["TMP"]) ‘;
} else {
echo ‘/tmp</b>" or "<b>C:tmp</b>" (or whatever’,
‘ the OS default "TMP" folder is set to)’;
}
echo ‘ is used in this case.’;
} else {
echo ‘The current "session.save_path" is "<b>’,
$sessionSavePath, ‘</b>".’;
}

echo ‘<br>Session file name: "<b>sess_’, session_id()
, ‘</b>".</div><br>’;
?>
[/php]

If you get error like this

[code]
Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php) in Unknown on line 0
[/code]

Follow the instruction to fix this issue:

[code]sudo vim /etc/php/apache2/php.ini[/code]

Find the session.save_path, if the folder doesn’t exist, create one.

[code]mkdir /var/lib/php/session[/code]

You may have to change ownership of the directly

[code]chown user:group /var/lib/php/session[/code]

Or just need to change the permissions to readable and writable for the directory

[code]chmod 0777 /var/lib/php/session[/code]

Note: /var/lib/php/session ownership and permissions well reverse back to root and not writable after a reboot. It’s a good idea to run chmod and chown @reboot so you don’t have to do it manually.

Once fixed this issue, run the script on your web server.

Here is the Output,

[code]The current "session.save_path" is "/var/lib/php/session".[/code]

If you get above output, phpmyadmin issue has resolved. Now you can start using phpmyadmin on your webserver.

Permanent link to this article: https://blog.openshell.in/2014/06/phpmyadmin-cannot-start-session-without-errors-please-check-errors/

Leave a Reply

Your email address will not be published.