php 警告:session_start() 失败:没有这样的文件或目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3262727/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 09:09:45  来源:igfitidea点击:

Warning: session_start() failed: No such file or directory

phpwarningssession-state

提问by Mohammad

I'm trying to install berta(v 0.6.3b) and I get this error:

我正在尝试安装berta(v 0.6.3b),但出现此错误:

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

警告: session_start() [function.session-start]: open(/var/php_sessions/sess_a0d6b8422181739d10066fb60cebfe5d, O_RDWR) failed: /hermes/bosweb/web010/b100/ipgcom/engine. _classes/class.bertasecurity.php

on line 75 The error seems to happen on line 75 of class.bertasecurity.php(view source code)

在第 75 行错误似乎发生在第 75 行class.bertasecurity.php查看源代码

What is wrong and how can I fix it?

出了什么问题,我该如何解决?

回答by Sarfraz

Make sure that session directory is writable or you can set a path yourself with:

确保会话目录可写,或者您可以自己设置路径:

session_save_path

session_save_path

This commentis also useful if you are using above function.

如果您使用上述功能,此注释也很有用。

回答by soulmerge

I think the folder containing the session data cannot be accessed by the PHP process.

我认为 PHP 进程无法访问包含会话数据的文件夹。

If you have not touched your php.ini, the default session.save_handlershould be files(which means that session data will be stored in a folder on your file system). The value of session.save_pathcontains that folder, you should check that it exists and its permissions for your php process.

如果你还没有接触过你的 php.ini,默认session.save_handler应该是files(这意味着会话数据将存储在你的文件系统上的一个文件夹中)。的值session.save_path包含该文件夹,您应该检查它是否存在以及它对您的 php 进程的权限。

回答by Daniel M. Melo

If you're changing the path that is being used for sessions.

如果您正在更改用于会话的路径。

You also might consider, fixing this problem by changing session.save_pathvariable in your php.inifile.

您还可以考虑通过更改文件中的session.save_path变量来解决此问题php.ini

Then you'll be fixing in your configuration file and not only in your script.

然后,您将在配置文件中进行修复,而不仅仅是在脚本中进行修复。

回答by Tjirp

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.

会话保存在您服务器的硬盘上。很可能您的会话保存路径不存在。尝试将其设置为确实存在或您具有读/写权限的目录。