phpMyAdmin "Cannot start session without errors"

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"
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 - Error

Cannot 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 = files

session.save_path = "/var/lib/php/session"

session.use_cookies = 1

session.name = PHPSESSID

session.auto_start = 0

session.cookie_lifetime = 0

session.cookie_path = /

session.cookie_domain =

session.serialize_handler = php

session.gc_probability = 1

session.gc_divisor     = 1000

session.gc_maxlifetime = 1440

session.bug_compat_42 = 0

session.bug_compat_warn = 1

session.referer_check =

session.entropy_length = 0

session.entropy_file =

session.cache_limiter = nocache

session.cache_expire = 180

session.use_trans_sid = 0

session.hash_function = 0

session.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/php

total 2

drwxrwx--- 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地址的形式来访问。

以上是网络提供的最常见的两个情况,另外还有几个形式,我都试过了,似乎都不行,而我今天的情况很特殊,一会能访问,一会不行,而且有个特点就是,每次重新启动浏览器第一次可以登入,退出后,直接在登陆才会出现这个提示,后来找到一个解决方法,就是登陆不了时就刷新页面后即可登入,具体原因目前上不清楚

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值