[英]codeigniter fatal error Call to a member function cookie() on a non-object
i have Codeigniter v202, and php version 5.2.17 my site works just good in my local but in the server i keep getting this error message in everypage, message in error log is: 我有Codeigniter v202和php版本5.2.17,我的站点在本地运行良好,但在服务器中,我一直在每个页面中收到此错误消息,错误日志中的消息是:
PHP Fatal error: Call to a member function cookie() on a non-object in /path/to/libraries/Session.php on line 138 PHP致命错误:在第138行的/path/to/libraries/Session.php中的非对象上调用成员函数cookie()
and in page i have 在页面中我有
A PHP Error was encountered 遇到PHP错误
Severity: Notice 严重程度:注意
Message: Undefined property: MY_CONTROLLER_NAME::$input 消息:未定义的属性:MY_CONTROLLER_NAME :: $ input
Filename: libraries/Session.php 文件名:libraries / Session.php
Line Number: 138 行号:138
this is line 138: 这是第138行:
$session = $this->CI->input->cookie($this->sess_cookie_name);
library is the original, i didnt make any changes on it. 库是原始的,我没有对其进行任何更改。 please help! 请帮忙!
I found what was wrong. 我发现出了什么问题。 i had 我有
setlocale(LC_ALL, 'tr_TR'); setlocale(LC_ALL,'tr_TR');
in my /index.php . 在我的/index.php中 。 so weird but session library did not initialize core input . 因此很奇怪,但是会话库没有初始化核心输入 。 it took me long to find but when i echo 我花了很长时间才找到,但是当我回声时
echo var_dump($this->CI);
there was ? 有 ? (question mark) instead of the char I then it was ?nput . (问号),而不是char ,然后输入 。 my locale didn't capitalize char i as I , that was the problem. 我的语言环境没有像我一样大写char i ,这就是问题所在。 weird thing is it worked in localhost but didn't work on the server. 奇怪的是,它在localhost中工作,但在服务器上不工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.