用户
 找回密码
 入住 CI 中国社区
搜索
查看: 4374|回复: 12
收起左侧

[版本 3.x] CI3.0加载session类后报500 Internal Server Error错误

[复制链接]
发表于 2016-1-26 00:22:51 | 显示全部楼层 |阅读模式
PHP5.3下没有问题,一切换到PHP5.4就不可以了
看过配置,PHP5.3与5.4的session.auto_start值均为0,5.4就是不行
PHP5.4使用原生session start,并直接使用$_SESSION全局数组是没问题的,说明session是开启的
就是一加载session类就出错,然而把php.ini里的session.auto_start设置为1 就可以了,这是为什么呢?
按说程序里手动加载和这个自动加载应该没什么关系的啊。
 楼主| 发表于 2016-2-4 14:30:20 | 显示全部楼层
Apaceh错误日志:
[Thu Feb 04 14:10:33.607297 2016] [core:error] [pid 3768:tid 1808] [client 127.0.0.1:56220] End of script output before headers: index.php
[Thu Feb 04 14:10:37.314510 2016] [core:error] [pid 3768:tid 1808] [client 127.0.0.1:56249] End of script output before headers: index.php
[Thu Feb 04 14:10:39.041608 2016] [mpm_winnt:crit] [pid 3768:tid 412] AH02538: Child: Parent process exited abruptly. Child process is ending
Starting the Apache2a service
The Apache2a service is running.
[core:warn] [pid 7156:tid 512] AH00098: pid file E:/phpStudy/Apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Feb 04 14:10:43.436860 2016] [mpm_winnt:notice] [pid 7156:tid 512] AH00455: Apache/2.4.10 (Win32) OpenSSL/0.9.8zb mod_fcgid/2.3.9 configured -- resuming normal operations
[Thu Feb 04 14:10:43.436860 2016] [mpm_winnt:notice] [pid 7156:tid 512] AH00456: Apache Lounge VC9 Server built: Jul 19 2014 13:20:51
[Thu Feb 04 14:10:43.436860 2016] [core:notice] [pid 7156:tid 512] AH00094: Command line: 'E:\\phpStudy\\Apache\\bin\\httpd.exe -d E:/phpStudy/Apache'
[Thu Feb 04 14:10:43.439860 2016] [mpm_winnt:notice] [pid 7156:tid 512] AH00418: Parent: Created child process 4904
[Thu Feb 04 14:10:45.114956 2016] [mpm_winnt:notice] [pid 4904:tid 408] AH00354: Child: Starting 150 worker threads.
[Thu Feb 04 14:10:46.559038 2016] [core:error] [pid 4904:tid 1788] [client 127.0.0.1:56311] End of script output before headers: index.php
 楼主| 发表于 2016-1-26 12:22:21 | 显示全部楼层
本帖最后由 sxycyrz 于 2016-1-26 12:27 编辑
Michael锐生 发表于 2016-1-26 10:27
是你改了什么东西吧?CI3.0里面默认是不能开启session.auto_start的,不然没办法正常使用 ...

刚下载的CI,还没有改过

http://codeigniter.org.cn/forums/thread-22083-1-1.html
这位朋友好像也是遇到的这种问题
我参考他的把session.auto_start设置为1后果然能用了,但是实在无法理解,因为即使不开启,我自己建 了一个test文件使用session都是正常的
发表于 2016-10-7 17:07:11 | 显示全部楼层
wish751 发表于 2016-4-19 17:14
我也和你遇到同样的问题
windows php环境5.4
注释 system\libraries\Session\Session.php 107行 session_ ...

刚才遇到了同样的问题。按照您的方法修改后真的没有问题了。我的是CI3.1,请问,为什么注释 了这一行就可以了呀?
发表于 2016-1-26 10:27:25 | 显示全部楼层
是你改了什么东西吧?CI3.0里面默认是不能开启session.auto_start的,不然没办法正常使用
1.png
发表于 2016-1-27 16:46:06 | 显示全部楼层
sxycyrz 发表于 2016-1-26 12:22
刚下载的CI,还没有改过

http://codeigniter.org.cn/forums/thread-22083-1-1.html

感觉还是代码哪里出了问题,用Xdebug追踪看一下吧,我也没什么头绪
发表于 2016-2-1 10:54:06 | 显示全部楼层
把PHP错误提示打开应该能看到具体报错。
 楼主| 发表于 2016-2-4 12:01:03 | 显示全部楼层
Hex 发表于 2016-2-1 10:54
把PHP错误提示打开应该能看到具体报错。

display_errors = off后还是报500的错误。。PHPstudy lite 2014
发表于 2016-2-4 12:01:54 | 显示全部楼层
sxycyrz 发表于 2016-2-4 12:01
display_errors = off后还是报500的错误。。PHPstudy lite 2014

难道不是应该等于 on ?
 楼主| 发表于 2016-2-4 14:26:53 | 显示全部楼层
本帖最后由 sxycyrz 于 2016-2-4 14:28 编辑
Hex 发表于 2016-2-4 12:01
难道不是应该等于 on ?

原来是on,报500,我改成off,还是500...嗯...改后也重启Apache了
发表于 2016-2-5 11:08:42 | 显示全部楼层
sxycyrz 发表于 2016-2-4 14:30
Apaceh错误日志:
[Thu Feb 04 14:10:33.607297 2016] [core:error]  [client 127.0.0.1:56220] End of scr ...

看起来不是 PHP 的问题。。。

本版积分规则