phpMyAdmin 中无法正常启动会话
将浏览器指向 phpMyAdmin 时出现以下错误
无法在没有错误的情况下启动会话,请检查 PHP 和/或网络服务器日志文件中给出的错误并正确配置 PHP 安装。
我已经检查了所有内容,但似乎无法找出问题所在。
在我的 php.ini 文件中,我有:
session.save_path = "/var/lib/php/session"
权限:
drwxr-xr-x 2 root apache 4096 Feb 16 04:47 session
似乎没有任何作用。甚至将会话目录的权限更改为 777。
I get the below error when pointing browser to phpMyAdmin
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.
I have checked everything and can't seem to figure out what the problem is.
In my php.ini file I have:
session.save_path = "/var/lib/php/session"
Permissions:
drwxr-xr-x 2 root apache 4096 Feb 16 04:47 session
Nothing seems to work. Even changing permission on session directory to 777.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(20)
对于 Xampp,从“根”文件夹中删除临时文件对我有用。
TH
For Xampp, Deleting temp flies from the 'root' folder works for me.
TH
我清除了浏览器缓存。创建了 phpinfo.php 中列出的会话文件夹。
成功了!
I cleared browser cache. Created session folder as listed in phpinfo.php.
It worked !
知道该线程被标记为已解决后,它就会尽早出现在 Google 搜索中针对给定术语的搜索中。因此,我认为提及可能导致此错误的另一个原因可能会有用。
如果您启用了“安全/安全 cookies”,则必须为 phpMyAdmin 禁用它,因为它们在激活后将无法工作。因此,请确保您
的配置中没有类似以下内容:
Knowing this thread is marked as solved, it shows up early on Google Search for the given term. So I thought it might be useful to mention another reason that can lead to this error.
If you enabled "safe/secure cookies", that has to be disabled for phpMyAdmin as it wont work with them being activated. So make sure you have nothing like:
in your config.
问题还可能是
php.ini
中的session.save_handler
值错误。当我将其更改为memcached
时出现此错误,并在更改回files
时再次出现此错误The problem can also be that you have a wrong
session.save_handler
value in yourphp.ini
. I got this error when I changed it tomemcached
, and worked again when changing back tofiles
我在 Windows Server 2016 中发现的问题是 PHP 使用的临时目录的权限错误。我添加了 IUSR。
Problem I found in Windows server 2016 was that the permissions were wrong on the temp directory used by PHP. I added IUSR.
有时,这是由于会话密钥无效造成的。如果使用 XAMPP,对我有用的是打开 XAMPP xampp/temp 中的临时文件夹,然后删除以 sess_ 开头的会话文件
This is sometimes due to an invalid session key. If using XAMPP, what worked for me was opening the temp folder in XAMPP xampp/temp then deleting the session files starting with sess_
我最近遇到了同样的问题。
通过截断 php 存储会话数据的临时目录解决了这个问题。
即对于 Unix 操作系统:
OP 参考号文件(此临时目录因您的操作系统而异)
在截断该目录后,我可以毫无问题地启动 phpmyadmin。
如果更改所有权和/或权限失败,我希望这可以帮助其他遇到同样问题的人。
I recently had this very same problem.
It was resolved by truncating the temp directory where php stores its session data.
ie for a Unix OS:
OP ref. file (this temp directory will differ for your OS)
After truncating the directory I was able to start phpmyadmin without issue.
I hope this helps others with the same problem if changing ownership and/or permissions fail.
如果您检查浏览器并且没有问题,请在服务器端检查这些命令:
根据
php.ini
文件中的session.save_path
,检查是否存在会话目录(默认路径是:
“/var/lib/php/session”
)因此,如果路径不存在,请创建它。
现在可能需要更改目录的所有权,例如(更改:基于您的系统的用户:组)
然后授予会话路径权限:
现在刷新您的浏览器
if you checked your browser and doesn't problem so check these commands on the server side :
based on
session.save_path
inphp.ini
file, check is exists session directory(default path is :
"/var/lib/php/session"
)so if path isn't exists, make it.
now may need to either change ownership of the directory, e.g (change: user:group based your system)
then give permission to session path:
now refresh your browser
对于 Ubuntu:
在我的例子中,错误指出问题出在哪里。
所以我只是运行这段代码,它就被修复了。
For Ubuntu:
In my case the error specify where is the issue.
So I just run this code and it is fixed.
问题通常出在您的浏览器端。
您需要刷新浏览器缓存,删除服务器/主机的 cookie,然后重试加载 phpMyAdmin。
如果您想全力以赴,请同时清除服务器上的会话文件夹。
一个可能的原因是
Problem usually lies on your browser end.
You need to flush your browser cache, delete the cookies for the server/host and then retry loading phpMyAdmin.
If you want to go all out, clear out the session folder on the server as well.
One possible reason for this is a session data mismatch between the browser and the webserver causing it to not be able to pull out the required session info and dumping this error dialogue on your lap.
该问题可能是由于文件和文件夹权限造成的;您可以尝试更改文件夹权限:
这将为 PHP 会话文件夹设置完全读/写权限。
注意:
php/session/
文件夹可能位于某些服务器上的不同位置。检查php.ini
中的会话路径。The problem can be due to file and folder permissions; You can try changing the folder permissions:
This will set full read/write permissions on the PHP sessions folder.
Note: the
php/session/
folder may be in a different location on some servers. Check yourphp.ini
for your session path.就我而言,这是
/var/lib/php/session
的错误所有权。我将其更改为 Apache 用户和组(网络服务器运行的用户和组),一切都很好。In my case it was the wrong ownership for
/var/lib/php/session
. I changed that to the Apache user and group (the user and group that the webserver runs as) and all was well.停止
777
!如果您使用 nginx(像我一样),只需将
/var/lib/php/
下的文件夹的所有权从apache
更改为nginx:
以及
/var/lib/phpMyAdmin/
下的文件夹:STOP
777
!If you use nginx (like me), just change the ownership of the folders under
/var/lib/php/
fromapache
tonginx
:And also for the folders under
/var/lib/phpMyAdmin/
:在
php.ini
中设置session.save_path
。确保您使用的是现有目录。如果您仍然发现任何问题,请写信&您要使用该文件夹的用户对该文件夹的执行权限。[这特别用于 IIS]
Set the
session.save_path
in yourphp.ini
. Make sure that you are using an existing directory.If still you found any issue then give write & execution permission to that folder for the user by which you are going to use that folder.[This is specially used in case of IIS]
此错误似乎有两个常见原因,一个与服务器配置和 session.save_path 有关,另一个与浏览器缓存有关。
如果您遇到此错误,请在尝试更改服务器上的 Apache 和 PHP 配置之前尝试使用不同的浏览器或计算机!
注意,清除服务器的Cookies还不够,还需要清除缓存。
在 Firefox 中,清除所有历史记录和 cookie 很容易,但您可能不想删除
一切。清除缓存在 Firefox 中是隐藏的:
“工具”>“选项>高级>网络:
缓存的网页内容 - 立即清除
There appears to be two common causes for this error, one is to do with the server configuration and the session.save_path and the other is the browser cache.
If you encounter this error try using a different browser or machine before you attempt to alter your Apache and PHP configurations on the server!
Note that clearing the Cookies for the server is not enough, you need to clear the cache.
In Firefox clearing all history and cookies is easy, but you may not want to get rid of
everything. Clearing the cache is hidden away in Firefox:
Tools > Options > Advanced > Network:
Cached Web Content - Clear Now
好的,
我使用的是 Windows 7 Ultimate 和 WAMP 2.4 服务器
tmp 文件夹丢失,所以我创建了一个,这解决了我的问题。
检查 php.ini 文件的正确路径:session.save_path
Ok,
I'm using windows 7 ultimate and WAMP 2.4 server
The tmp folder was missing, so I created one and this solved my problem.
Check the php.ini file for the correct path: session.save_path
如果会话文件夹不可写,则登录失败。要检查这一点,请在您的 Web 目录中创建一个 PHP 文件:
如果会话文件夹不可写,请执行
sudo setfacl -R -mu:www-data:rwx
或chmod 777 <会话目录>
-
Login fails if session folder in not writeable. To check that, create a PHP file in your web directory with:
If session folder is not writeable do either
sudo setfacl -R -m u:www-data:rwx <session directory>
orchmod 777 <session directory>
-
第一:如果不是
session
目录(在我的例子中是)第二:为
session
目录设置权限First: if not
session
dir (in my case it was)Second: set privilege for
session
dir就我而言,问题是由于磁盘空间不足造成的。我想向像我这样的其他用户提及这一点:)
In my case, problem was due to low disk space. I want to mention it for other users like me :)
我花了一整天的时间来解决同样的问题。我的答案是简单地清除浏览器的缓存。太糟糕了,我已经重新安装了 webserver/phpmyadmin 3 次了。 :(
I worked on this same problem for a full day. The answer for me was to simply clear my browser's cache. Too bad, I had already reinstalled the webserver/phpmyadmin 3 times. :(