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

[HELP] 日志里面没报错 页面却打开错误500 怎么找出错在哪里呢

[复制链接]
发表于 2014-10-4 00:03:20 | 显示全部楼层 |阅读模式
程序在本地能正常运行

上传到了服务器

能打开的页面日志是
PHP复制代码
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
 
DEBUG - 2014-10-03 16:00:24 --> Config Class Initialized
DEBUG - 2014-10-03 16:00:24 --> Hooks Class Initialized
DEBUG - 2014-10-03 16:00:24 --> Utf8 Class Initialized
DEBUG - 2014-10-03 16:00:24 --> UTF-8 Support Enabled
DEBUG - 2014-10-03 16:00:24 --> URI Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Router Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Output Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Security Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Input Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Global POST and COOKIE data sanitized
DEBUG - 2014-10-03 16:00:25 --> Language Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Loader Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Controller Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Helper loaded: url_helper
DEBUG - 2014-10-03 16:00:25 --> Helper loaded: file_helper
DEBUG - 2014-10-03 16:00:25 --> Model Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Model Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Database Driver Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Model Class Initialized
DEBUG - 2014-10-03 16:00:25 --> Pagination Class Initialized
DEBUG - 2014-10-03 16:00:25 --> File loaded: application/views/admin/category_index.php
DEBUG - 2014-10-03 16:00:25 --> File loaded: application/views/admin/sys_entry.php
DEBUG - 2014-10-03 16:00:25 --> Final output sent to browser
DEBUG - 2014-10-03 16:00:25 --> Total execution time: 0.2585
DEBUG - 2014-10-03 16:00:26 --> Config Class Initialized
DEBUG - 2014-10-03 16:00:26 --> Hooks Class Initialized
DEBUG - 2014-10-03 16:00:26 --> Utf8 Class Initialized
DEBUG - 2014-10-03 16:00:26 --> UTF-8 Support Enabled
DEBUG - 2014-10-03 16:00:26 --> URI Class Initialized
DEBUG - 2014-10-03 16:00:26 --> Router Class Initialized
 
复制代码



不能打开错误没提示 页面500内部错误的日志是
PHP复制代码
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
 
DEBUG - 2014-10-03 16:03:50 --> Config Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Hooks Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Utf8 Class Initialized
DEBUG - 2014-10-03 16:03:50 --> UTF-8 Support Enabled
DEBUG - 2014-10-03 16:03:50 --> URI Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Router Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Output Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Security Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Input Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Global POST and COOKIE data sanitized
DEBUG - 2014-10-03 16:03:50 --> Language Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Loader Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Controller Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Helper loaded: url_helper
DEBUG - 2014-10-03 16:03:50 --> Model Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Model Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Database Driver Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Helper loaded: file_helper
DEBUG - 2014-10-03 16:03:50 --> Model Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Config Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Hooks Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Utf8 Class Initialized
DEBUG - 2014-10-03 16:03:50 --> UTF-8 Support Enabled
DEBUG - 2014-10-03 16:03:50 --> URI Class Initialized
DEBUG - 2014-10-03 16:03:50 --> Router Class Initialized
 
复制代码



请问前辈们能帮我从这个日志对比找出出错页面打不开的原因吗
不然错误500 你们一般是怎么排除找出bug的呢?
 楼主| 发表于 2014-10-4 12:13:56 | 显示全部楼层
找到原因了

PHP复制代码
public function get_list($tid = 0,$limit = 0,$offset = 0)
        {
                if(empty(intval($tid))){
                        return false;
                }
               
                if(empty(intval($limit))){
                        return false;
                }
复制代码


上面两个变量判断改成下面代码就运行正常了
PHP复制代码
if(!ctype_digit($tid))return false;
               
                if(!ctype_digit($limit))return false;
复制代码


这个写法日志和页面都没报错 我就想不通是php语法问题还是ci的问题

本版积分规则