Xampp 7.0.1 Apache 在我使用 session_start() 时崩溃
Xampp 7.0.1 Apache crashes when I use session_start()
当我在 PHP 中使用 session_start() 启动会话时,我的 Apache 服务器停止工作。
我正在为 Windows 使用 Xampp 7.0.1。
我的配置文件如下所示:
<?php
error_reporting(E_ALL);
//session_start();
//ob_start();
header('Content-Type: text/html; charset=utf-8');
//Rest of the code
?>
即使我把它放在文件的第一行也不起作用。
有人知道如何解决这个问题吗?
奇怪的是,它只发生在这个特定的地图结构中。
即
C:\xampp\htdocs\functions\*
例如:
C:\xampp\htdocs\test\*
它工作正常。
我认为首先你应该在 php.ini
中设置 session.save_path
另请确保您 php.ini 的设置正确。
创建 index.php 和 echo phpinfo();
确保所有必需的服务都已开启。
Here 是解决方案,它是 XAMPP 错误,他们目前正在修复它。如果这不起作用,请尝试等待 XAMPP 7.0.2 或降级直到修复程序出来。
we have been checking the configuration of XAMPP and we found that the
issue is related to the use_only_cookies variable that you can find in
the Session's section of the php.ini file. Apache will crash if the
use_only_cookies variable in the Session's section is set to 0 and
everything is fine if it's set to 1.
http://php.net/manual/en/session.configuration.php#ini.session.use-only-cookies
We also checked that the use_strict_mode should be set to 1.
https://wiki.php.net/rfc/strict_sessions
http://php.net/manual/en/session.configuration.php#ini.session.use-strict-mode
We'll include those changes in the next version of XAMPP with PHP 7.
We are building the installers with the version 7.0.2 and we'll
release them as soon as possible.
当我在 PHP 中使用 session_start() 启动会话时,我的 Apache 服务器停止工作。
我正在为 Windows 使用 Xampp 7.0.1。
我的配置文件如下所示:
<?php
error_reporting(E_ALL);
//session_start();
//ob_start();
header('Content-Type: text/html; charset=utf-8');
//Rest of the code
?>
即使我把它放在文件的第一行也不起作用。
有人知道如何解决这个问题吗?
奇怪的是,它只发生在这个特定的地图结构中。
即
C:\xampp\htdocs\functions\*
例如:
C:\xampp\htdocs\test\*
它工作正常。
我认为首先你应该在 php.ini
中设置 session.save_path
另请确保您 php.ini 的设置正确。
创建 index.php 和 echo phpinfo();
确保所有必需的服务都已开启。
Here 是解决方案,它是 XAMPP 错误,他们目前正在修复它。如果这不起作用,请尝试等待 XAMPP 7.0.2 或降级直到修复程序出来。
we have been checking the configuration of XAMPP and we found that the issue is related to the use_only_cookies variable that you can find in the Session's section of the php.ini file. Apache will crash if the use_only_cookies variable in the Session's section is set to 0 and everything is fine if it's set to 1.
http://php.net/manual/en/session.configuration.php#ini.session.use-only-cookies
We also checked that the use_strict_mode should be set to 1.
https://wiki.php.net/rfc/strict_sessions http://php.net/manual/en/session.configuration.php#ini.session.use-strict-mode
We'll include those changes in the next version of XAMPP with PHP 7. We are building the installers with the version 7.0.2 and we'll release them as soon as possible.