警告:session_start()失败:没有这样的文件或目录
我正在尝试安装 berta (v 0.6.3b),但收到此错误:
警告:session_start() [function.session-start]: 打开(/var/php_sessions/sess_a0d6b8422181739d10066fb60cebfe5d,O_RDWR) 失败:没有这样的文件或目录 (2) /hermes/bosweb/web010/b100/ipg.ellieniemeyercom/engine/_classes/class.bertasecurity.php
第 75 行 该错误似乎发生在 class.bertasecurity.php
的第 75 行(查看源代码)
有什么问题以及如何修复它?
I'm trying to install berta (v 0.6.3b) and I get this error:
Warning: session_start() [function.session-start]:
open(/var/php_sessions/sess_a0d6b8422181739d10066fb60cebfe5d, O_RDWR)
failed: No such file or directory (2) in
/hermes/bosweb/web010/b100/ipg.ellieniemeyercom/engine/_classes/class.bertasecurity.php
on line 75 The error seems to happen on line 75 of class.bertasecurity.php
(view source code)
What is wrong and how can I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
确保会话目录可写,或者您可以自己设置路径:
session_save_path
如果您正在使用上述功能,此注释也很有用。
Make sure that session directory is writable or you can set a path yourself with:
session_save_path
This comment is also useful if you are using above function.
我认为 PHP 进程无法访问包含会话数据的文件夹。
如果您还没有触及 php.ini,则默认
session.save_handler
应该是文件(这意味着会话数据将存储在文件系统上的文件夹中)。session.save_path< 的值/code>
包含该文件夹,您应该检查它是否存在以及它对您的 php 进程的权限。
I think the folder containing the session data cannot be accessed by the PHP process.
If you have not touched your php.ini, the default
session.save_handler
should be files (which means that session data will be stored in a folder on your file system). The value ofsession.save_path
contains that folder, you should check that it exists and its permissions for your php process.如果您要更改会话所使用的路径。
您还可以考虑通过更改
php.ini
文件中的session.save_path
变量来解决此问题。然后,您将在配置文件中进行修复,而不仅仅是在脚本中进行修复。
If you're changing the path that is being used for sessions.
You also might consider, fixing this problem by changing
session.save_path
variable in yourphp.ini
file.Then you'll be fixing in your configuration file and not only in your script.
会话保存在服务器的硬盘上。您的会话保存路径很可能不存在。尝试将其设置为确实存在或您具有读/写权限的目录。
Sessions are saved on the harddisk of your server. Most likely your session save path does not exist. Try setting it to a directory that does exist or that you have read/write rights to.
我们在将网站从 cPanel 服务器迁移到其他主机时遇到了此问题。
session.save_path
是在public_html/
文件夹内的php.ini
和.user.ini
中配置的,并且可能会覆盖主机想要使用的默认路径。我们认为根本不需要这些文件,只是旧服务器的遗留问题,然后删除/重命名它们,这解决了问题。
We encountered this problem when migrating a website from a cPanel server to a different host.
The
session.save_path
was configured inphp.ini
and.user.ini
inside ourpublic_html/
folder, and was presumably overwriting a default path the host would have wanted to use.We decided the files were not needed at all, just a hangover from the old server, and deleted/renamed them out of the way, and this fixed the problem.