如果页面具有session_start(),则不会加载页面;在里面 [英] Pages wont load if it has session_start(); in it

查看:93
本文介绍了如果页面具有session_start(),则不会加载页面;在里面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近从WAMP切换到XAMPP,因为我想要PHP 7,但是我注意到我以前从未体验过的东西,它不会加载其中包含session_start();的php文件.我刚在Chrome/IE/FF中收到正在等待localhost ...".一旦删除该行,页面就会加载.

I've recently switched from years of WAMP to XAMPP because I wanted PHP 7, but I've noticed something I've never experienced before, it wont load php files that have session_start(); in them. I just get "Waiting for localhost..." in Chrome/IE/FF. As soon as I remove that line the page loads.

在沼泽中工作得很好.

基本上每个包含session_start();的页面都不会加载,非常奇怪.但是,如果我删除它,它们会加载并显示.

Basically every page that contains session_start(); wont load, super weird. But if I remove it, they load and show.

为什么?

错误日志只是通知

[Sun Dec 27 02:52:19.346602 2015] [mpm_winnt:notice] [pid 3272:tid 372] AH00455: Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.0 configured -- resuming normal operations
[Sun Dec 27 02:52:19.346602 2015] [mpm_winnt:notice] [pid 3272:tid 372] AH00456: Apache Lounge VC14 Server built: Dec  9 2015 10:17:39
[Sun Dec 27 02:52:19.346602 2015] [core:notice] [pid 3272:tid 372] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Dec 27 02:52:19.348604 2015] [mpm_winnt:notice] [pid 3272:tid 372] AH00418: Parent: Created child process 2744
[Sun Dec 27 02:52:19.607869 2015] [ssl:warn] [pid 2744:tid 380] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 27 02:52:19.674491 2015] [ssl:warn] [pid 2744:tid 380] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 27 02:52:19.699518 2015] [mpm_winnt:notice] [pid 2744:tid 380] AH00354: Child: Starting 150 worker threads.

刚发现这个问题,我有 exact 相同的问题.他从未找到解决方案

just found this, I have the exact same problem. he never found a solution

session_start()可以使文件永久保存

我回到WAMP并自己安装了php7

I went back to WAMP and installed php7 myself

推荐答案

在php.ini中查找:

Find in php.ini:

session.use_only_cookies=0 

更改为:

session.use_only_cookies=1

我在使用最新的XAMPP版本7.0.1和php7时遇到了同样的麻烦.

I had the same trouble with the latest XAMPP version 7.0.1 with php7.

通过Apache Friends支持的Bitnami开发人员:

According to Bitnami Developers via Apache Friends Support:

问题与您可以使用的use_only_cookies变量有关 在php.ini文件的会话"部分中找到.阿帕奇将崩溃 如果会话"部分中的use_only_cookies变量设置为0 如果设置为1,一切都很好.

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.

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

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.

希望这会有所帮助.

这篇关于如果页面具有session_start(),则不会加载页面;在里面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆