phpMyAdmin "Cannot start session without errors"這個問題目前已經解決,但是有點搞笑:是這樣的,如果將項目放到遠程伺服器,那麼資料庫連接也是遠程登陸,所以在phpMyAdmin的設定檔:config.default.ini裡頭有2個參數應該配置如下: $cfg['blowfish_secret'] = 'cookie';$cfg['Servers'][$i]['auth_type'] = 'cookie'; 特此記錄,自嘲一下!=====================================================================phpMyAdmin "Cannot start session without errors"轉載自:http://hi.baidu.com/suping/blog/item/2f0f0ff79b635528720eec0c.html
| Yesterday one of my customers reported their phpMyAdmininstall was showing the error message "Cannot start session withouterrors" and they were unable to even get to the phpMyAdmin loginpage. This post looks at what caused the issue and how to fixit. The error message in question looks like this: phpMyAdmin - ErrorCannot start session without errors, please check errors given inyour PHP and/or webserver log file and configure your PHPinstallation properly. Clearly there's something wrong with the way sessions are beingused. I checked the Apache error log file and it didn't actuallyshow any error messages and I don't have PHP logging errorsseparately. The next step was to have a look at the php.ini file and seewhat the session settings are. This is on a CentOS 5 webserver witha default install. I've removed all the unecessary commentsetc: [Session]session.save_handler = filessession.save_path = "/var/lib/php/session"session.use_cookies = 1session.name = PHPSESSIDsession.auto_start = 0session.cookie_lifetime = 0session.cookie_path = /session.cookie_domain =session.serialize_handler = phpsession.gc_probability = 1session.gc_divisor = 1000session.gc_maxlifetime = 1440session.bug_compat_42 = 0session.bug_compat_warn = 1session.referer_check =session.entropy_length = 0session.entropy_file =session.cache_limiter = nocachesession.cache_expire = 180session.use_trans_sid = 0session.hash_function = 0session.hash_bits_per_character = 5 I couldn't see anything wrong there, so I figured the nextlogical step was to check the directory specified by thesession.save_path option as follows: ls -l /var/lib/phptotal 2drwxrwx--- 2 root apache 2048 Jul 17 11:56 session That shows us that the session directory is owned by "root", theuser is "apache" and it can be written to by both user and groupbut no one else. That all looks fine but we run this particularwebserver as a user other than "apache". It would therefore appear that when I did an upgrade of PHP alittle while back it restored the user permissions back toroot:apache instead of leaving them root:myusername (myusernameisn't the actual username in question - just an example). I ammaking an assumption here because there shouldn't be any otherreason for the permissions to have changed. A simple chown is all that's required: sudo chown -R root:myusername /var/lib/php/session and then the error in phpMyAdmin went away and we were able tolog in again. So, assuming I am correct that a PHP upgrade on CentOS restoredthe PHP session directory default permissions, if you run Apache onCentOS as a user other than "apache" you need to make sure youcheck the permissions of your PHP session directory afterupgrading. This will affect any websites using PHP file basedsessions, not just phpMyAdmin. |
-------------------------------------------------------------
其他解決方案建議:
今天在登入伺服器用phpmyadmin管理資料庫時突然出現提示:
phpMyAdmin – Error
Cannot start session without errors, please check errors given inyour PHP and/or webserver log file and configure your PHPinstallation properly.
網路上提供幾個解決方案:
1.在php的目錄建立個檔案夾Temp,設定Temp屬性為IIS_Users組除完全控制的所有許可權。(IIS_Users為IIS匿名使用者組),在php.ini找到session.save_path這一行,設成session.save_path = “D:/host/php/Temp”(把分號去掉)。
解決辦法:
將php.ini中的session.auto_start的值改為1(啟動),預設是0(禁用),
在php.ini找到session.save_path 這一行,設成session.save_path =“D:/host/php/Temp” (把分號去掉)
在phpmyadmin中找到,config.sample.inc.php,改成config.inc.php,
找到 $cfg['blowfish_secret'] 將後面的賦值,加入數字和字母組合。
2.在 hosts 中添加記錄
192.168.137.129 a.com
192.168.137.129 www.a.com
然後使用
http://www.a.com/phpmyadmin/來訪問,這下就OK了!也就是說,不可以用IP地址的形式來訪問。
以上是網路提供的最常見的兩個情況,另外還有幾個形式,我都試過了,似乎都不行,而我今天的情況很特殊,一會能訪問,一會不行,而且有個特點就是,每次重新啟動瀏覽器第一次可以登入,退出後,直接在登陸才會出現這個提示,後來找到一個解決方案,就是登陸不了時就重新整理頁面後即可登入,具體原因目前上不清楚