在使用会话时xampp上可能导致ERR_CONNECTION_RESET错误的原因

ovx*_*l0w 6 php windows apache xampp session

我有xampp(Windows)的问题,我session_start();在我的文件中,但它喜欢滴请求...

当我尝试访问网页localhost/folder/index.php它的工作原理,但是当我尝试 external ip/folder/index.php127.0.0.1/folder/index.php或者[::1]/folder/index.php它只是丢弃连接(试过多种浏览器和Chrome给人ERR_CONNECTION_RESET......我无言以对,我迫切需要帮助... ...它工作时,我删除了session_start();从我的文件..当我用session_start();它制作新文件时仍然无法正常工作......

一些error.log行

[Sun Jan 10 19:33:45.805036 2016] [:error] [pid 3176:tid 1888] [client myip:50143] script 'C:/xampp/htdocs/h3x1t/i\xc2\xb4\xc2\xb4.php' not found or unable to stat
[Sun Jan 10 20:02:40.330149 2016] [ssl:warn] [pid 24588:tid 552] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jan 10 20:02:40.373728 2016] [mpm_winnt:notice] [pid 24588:tid 552] AH00354: Child: Starting 150 worker threads.
[Sun Jan 10 20:04:25.949925 2016] [mpm_winnt:notice] [pid 29460:tid 564] AH00428: Parent: child process 24588 exited with status 3221225477 -- Restarting.
[Sun Jan 10 20:04:26.568746 2016] [ssl:warn] [pid 29460:tid 564] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jan 10 20:04:26.615700 2016] [mpm_winnt:notice] [pid 29460:tid 564] AH00455: Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.1 configured -- resuming normal operations
[Sun Jan 10 20:04:26.615700 2016] [mpm_winnt:notice] [pid 29460:tid 564] AH00456: Apache Lounge VC14 Server built: Dec  9 2015 10:17:39
[Sun Jan 10 20:04:26.615700 2016] [core:notice] [pid 29460:tid 564] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Jan 10 20:04:26.622190 2016] [mpm_winnt:notice] [pid 29460:tid 564] AH00418: Parent: Created child process 26200
[Sun Jan 10 20:04:27.302705 2016] [ssl:warn] [pid 26200:tid 560] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jan 10 20:04:27.475560 2016] [ssl:warn] [pid 26200:tid 560] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jan 10 20:04:27.518770 2016] [mpm_winnt:notice] [pid 26200:tid 560] AH00354: Child: Starting 150 worker threads.
[Sun Jan 10 20:04:28.693791 2016] [mpm_winnt:notice] [pid 29460:tid 564] AH00428: Parent: child process 26200 exited with status 3221225477 -- Restarting.
[Sun Jan 10 20:04:29.379751 2016] [ssl:warn] [pid 29460:tid 564] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jan 10 20:04:29.425188 2016] [mpm_winnt:notice] [pid 29460:tid 564] AH00455: Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.1 configured -- resuming normal operations
[Sun Jan 10 20:04:29.425188 2016] [mpm_winnt:notice] [pid 29460:tid 564] AH00456: Apache Lounge VC14 Server built: Dec  9 2015 10:17:39
[Sun Jan 10 20:04:29.425188 2016] [core:notice] [pid 29460:tid 564] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Jan 10 20:04:29.430191 2016] [mpm_winnt:notice] [pid 29460:tid 564] AH00418: Parent: Created child process 30668
[Sun Jan 10 20:04:30.081357 2016] [ssl:warn] [pid 30668:tid 608] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jan 10 20:04:30.254197 2016] [ssl:warn] [pid 30668:tid 608] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jan 10 20:04:30.297173 2016] [mpm_winnt:notice] [pid 30668:tid 608] AH00354: Child: Starting 150 worker threads.
[Sun Jan 10 20:06:24.444492 2016] [:error] [pid 30668:tid 1896] [client ::1:60405] script 'C:/xampp/htdocs/h3x1t/contracts.php' not found or unable to stat, referer: http://localhost/h3x1t/index
Run Code Online (Sandbox Code Playgroud)

小智 7

我有PHP7的XAMPP和同样的问题......

我在php.ini中更改了:session.use_only_cookies从0改为1并且一切正常.


小智 6

就我而言,Windows 事件查看器显示了更多有用的数据。它指向 VCRUNTIME140.dll 不断导致 Apache 崩溃(这导致控制台显示 ERR_CONNECTION_RESET),因此我将库更新为https://www.microsoft.com/en-us/download/confirmation.aspx?id=52685 - 然后,它显示错误模块为 php7ts.dll - 所以我按照http://ibraransari.blogspot.com/2017/01/how-to-solve-apache-crash-fault-module.html的说明进行操作,我很高兴去。


ovx*_*l0w 5

我用旧的 PHP 版本重新安装了 xampp ...

看起来罪魁祸首是 PHP 7.0.0

编辑:发现可能与它相关的内容 https://community.apachefriends.org/viewtopic.php?p=248070&sid=0b7559defe15317f41699d1ce9194e3f

EDIT2:发现这个(bitnami 开发人员)

我们一直在检查 XAMPP 的配置,我们发现问题与 use_only_cookies 变量有关,您可以在 php.ini 文件的会话部分找到该变量。如果 Session 部分中的 use_only_cookies 变量设置为 0,Apache 将崩溃,如果设置为 1,则一切正常。

http://php.net/manual/en/session.configuration.php#ini.session.use-only-cookies

我们还检查了 use_strict_mode 应该设置为 1。

https://wiki.php.net/rfc/strict_sessions http://php.net/manual/en/session.configuration.php#ini.session.use-strict-mode

我们将在下一个 XAMPP 版本的 PHP 7 中包含这些更改。我们正在使用 7.0.2 版构建安装程序,我们将尽快发布它们。