Hex
发表于 2011-2-10 14:36:17
你这个很奇怪,建议重新下载一份 CI 覆盖。
注意版本,不要弄错了,现在是 2.0 了。
你这个代码看不出问题,你可以打包发上来,我本地帮你调试下。
MYCODEIGNITER
发表于 2011-2-11 11:32:09
各位神们,接上面的问题。。两个完全一样的项目,放windows上的不会出现上面问题,放到linux 就出现上面的问题,这是怎么回事啊。。
bluelomo
发表于 2011-2-11 11:44:49
我日,连版本号都不说
MYCODEIGNITER
发表于 2011-2-11 11:54:33
版本是1.7.2的
Hex
发表于 2011-2-11 11:57:56
回复 12# MYCODEIGNITER
一种可能是文件名和类名大小写问题。另外的就是 PHP 配置或者 Apache 配置问题。先排查大小写问题,大小写问题请看手册,都有详细说明。
MYCODEIGNITER
发表于 2011-2-11 12:21:40
大小写好像没问题:
contrller:
文件名:home.php
class Home extends Controller{
function Home(){
parent::controller();
$this->load->helper('url');
}
function index(){
$this->load->model('information_model');
$this->load->model('news_model');
$event = $this->information_model->list_events('COUNT_TOP_EVENTS');
$news = $this->news_model->list_news();
$ticket_info = $this->information_model->list_ticket_info();
$pickup_event = $this->information_model->list_pickup_event();
-------------------------------------------------
model
文件名:information_model.php
class Information_model extends Model {
function Information_model()
{
parent::Model();
$this->config->load('bnlc_config');
}
function display_sql($str) {
$debug = $this->config->item('DEBUG');
if (strcmp($debug, 'ON') == 0) {
echo $str . " " . $this->db->last_query() . "<br />";
}
}
Hex
发表于 2011-2-11 13:01:51
回复 16# MYCODEIGNITER
那你这就是服务器问题了,如果是服务器问题就不好排查了。建议你设置断点,看看到底是因为什么导致的那个错误。
MYCODEIGNITER
发表于 2011-2-11 13:18:25
我晕了。。服务器一直都没去动过配置。。老大们,你们觉得哪里最有可能发生问题。。
Hex
发表于 2011-2-11 13:37:14
回复 18# MYCODEIGNITER
这个我说不好,不过我可以肯定不是 CI 的问题。
MYCODEIGNITER
发表于 2011-2-11 13:40:34
我现在用干净的1.7.2 测试了一下
$this->load->model('information_model');还是出错
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Welcome::$information_model
Filename: controllers/welcome.php
Line Number: 14