9com's Blog

Service Solution So good ==> Ninecom

การแก้ปัญหาของ 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.

  • เบื้องต้นให้เรากำหนดค่าต่าง ๆตาม
  • ถ้ายังไม่ได้ให้ของใช้ scripts นี้ทดสอบการทำงานของ session
<?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>';
?>
  • ถ้าการทำงานถูกต้องจะต้องไม่มี warnning เตือนขึ้นมา
  • ถ้ามี error เตือนหมายความว่า session ของเราไม่สามารทำงานได้ ให้เราตรวจสอบที่ /etc/php5/apache2/php.ini ว่าเรากำหนด directory ของ session ไว้ที่ใด ที่ parameter session.save_path = “tmp/session”
  • ในกรณีข้างบนนี้กำหนดว่าเราจะเก็บ session ที่ tmp/session เพราะฉะนั้นเราต้องกำหนด mod ของ floder ให้สามารถอ่านเขียนได้
  • ลองเรียก phpmyadmin ทำงานอีกครั้ง

August 5, 2009 - Posted by | Admin

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.