linshunhuang 发表于 2016-4-11 20:33:13

发布到空间时,$RTR中的Class=""导致404

如题目,发布到空间后,发现所有页面全是404。追踪之后发现时在system/core/CodeIgniter.php的这个抛出404。

        $e404 = FALSE;
        $class = ucfirst($RTR->class);
        $method = $RTR->method;

       
        if (empty($class) OR ! file_exists(APPPATH.'controllers/'.$RTR->directory.$class.'.php'))
        {
                $e404 = TRUE;
        }


$RTR中Class=""的值是:
object(CI_Router)#7 (9) {
["config"]=>
&object(CI_Config)#3 (3) {
    ["config"]=>
    &array(48) {
      ["base_url"]=>
      string(21) "http://113.10.183.18/"
      ["index_page"]=>
      string(9) "index.php"
      ["uri_protocol"]=>
      string(11) "REQUEST_URI"
      ["url_suffix"]=>
      string(0) ""
      ["language"]=>
      string(7) "english"
      ["charset"]=>
      string(5) "UTF-8"
      ["enable_hooks"]=>
      bool(false)
      ["subclass_prefix"]=>
      string(3) "MY_"
      ["composer_autoload"]=>
      bool(false)
      ["permitted_uri_chars"]=>
      string(14) "a-z 0-9~%.:_\-"
      ["allow_get_array"]=>
      bool(true)
      ["enable_query_strings"]=>
      bool(true)
      ["controller_trigger"]=>
      string(1) "c"
      ["function_trigger"]=>
      string(1) "m"
      ["directory_trigger"]=>
      string(1) "d"
      ["log_threshold"]=>
      int(0)
      ["log_path"]=>
      string(0) ""
      ["log_file_extension"]=>
      string(0) ""
      ["log_file_permissions"]=>
      int(420)
      ["log_date_format"]=>
      string(11) "Y-m-d H:i:s"
      ["error_views_path"]=>
      string(0) ""
      ["cache_path"]=>
      string(0) ""
      ["cache_query_string"]=>
      bool(true)
      ["encryption_key"]=>
      string(0) ""
      ["sess_driver"]=>
      string(5) "files"
      ["sess_cookie_name"]=>
      string(10) "ci_session"
      ["sess_expiration"]=>
      int(7200)
      ["sess_save_path"]=>
      NULL
      ["sess_match_ip"]=>
      bool(false)
      ["sess_time_to_update"]=>
      int(300)
      ["sess_regenerate_destroy"]=>
      bool(false)
      ["cookie_prefix"]=>
      string(0) ""
      ["cookie_domain"]=>
      string(0) ""
      ["cookie_path"]=>
      string(1) "/"
      ["cookie_secure"]=>
      bool(false)
      ["cookie_httponly"]=>
      bool(false)
      ["standardize_newlines"]=>
      bool(false)
      ["global_xss_filtering"]=>
      bool(false)
      ["csrf_protection"]=>
      bool(false)
      ["csrf_token_name"]=>
      string(14) "csrf_test_name"
      ["csrf_cookie_name"]=>
      string(16) "csrf_cookie_name"
      ["csrf_expire"]=>
      int(7200)
      ["csrf_regenerate"]=>
      bool(true)
      ["csrf_exclude_uris"]=>
      array(0) {
      }
      ["compress_output"]=>
      bool(false)
      ["time_reference"]=>
      string(5) "local"
      ["rewrite_short_tags"]=>
      bool(false)
      ["proxy_ips"]=>
      string(0) ""
    }
    ["is_loaded"]=>
    array(0) {
    }
    ["_config_paths"]=>
    array(1) {
      =>
      string(33) "/www/users/H10044964/application/"
    }
}
["routes"]=>
array(2) {
    ["view/(:num)"]=>
    string(12) "main/view/$1"
    ["pic"]=>
    string(11) "main/pic/$1"
}
["class"]=>
string(0) ""
["method"]=>
string(5) "index"
["directory"]=>
NULL
["default_controller"]=>
string(10) "main/index"
["translate_uri_dashes"]=>
bool(false)
["enable_query_strings"]=>
bool(true)
["uri"]=>
&object(CI_URI)#6 (6) {
    ["keyval"]=>
    array(0) {
    }
    ["uri_string"]=>
    string(0) ""
    ["segments"]=>
    array(0) {
    }
    ["rsegments"]=>
    array(0) {
    }
    ["_permitted_uri_chars":protected]=>
    NULL
    ["config"]=>
    &object(CI_Config)#3 (3) {
      ["config"]=>
      &array(48) {
      ["base_url"]=>
      string(21) "http://113.10.183.18/"
      ["index_page"]=>
      string(9) "index.php"
      ["uri_protocol"]=>
      string(11) "REQUEST_URI"
      ["url_suffix"]=>
      string(0) ""
      ["language"]=>
      string(7) "english"
      ["charset"]=>
      string(5) "UTF-8"
      ["enable_hooks"]=>
      bool(false)
      ["subclass_prefix"]=>
      string(3) "MY_"
      ["composer_autoload"]=>
      bool(false)
      ["permitted_uri_chars"]=>
      string(14) "a-z 0-9~%.:_\-"
      ["allow_get_array"]=>
      bool(true)
      ["enable_query_strings"]=>
      bool(true)
      ["controller_trigger"]=>
      string(1) "c"
      ["function_trigger"]=>
      string(1) "m"
      ["directory_trigger"]=>
      string(1) "d"
      ["log_threshold"]=>
      int(0)
      ["log_path"]=>
      string(0) ""
      ["log_file_extension"]=>
      string(0) ""
      ["log_file_permissions"]=>
      int(420)
      ["log_date_format"]=>
      string(11) "Y-m-d H:i:s"
      ["error_views_path"]=>
      string(0) ""
      ["cache_path"]=>
      string(0) ""
      ["cache_query_string"]=>
      bool(true)
      ["encryption_key"]=>
      string(0) ""
      ["sess_driver"]=>
      string(5) "files"
      ["sess_cookie_name"]=>
      string(10) "ci_session"
      ["sess_expiration"]=>
      int(7200)
      ["sess_save_path"]=>
      NULL
      ["sess_match_ip"]=>
      bool(false)
      ["sess_time_to_update"]=>
      int(300)
      ["sess_regenerate_destroy"]=>
      bool(false)
      ["cookie_prefix"]=>
      string(0) ""
      ["cookie_domain"]=>
      string(0) ""
      ["cookie_path"]=>
      string(1) "/"
      ["cookie_secure"]=>
      bool(false)
      ["cookie_httponly"]=>
      bool(false)
      ["standardize_newlines"]=>
      bool(false)
      ["global_xss_filtering"]=>
      bool(false)
      ["csrf_protection"]=>
      bool(false)
      ["csrf_token_name"]=>
      string(14) "csrf_test_name"
      ["csrf_cookie_name"]=>
      string(16) "csrf_cookie_name"
      ["csrf_expire"]=>
      int(7200)
      ["csrf_regenerate"]=>
      bool(true)
      ["csrf_exclude_uris"]=>
      array(0) {
      }
      ["compress_output"]=>
      bool(false)
      ["time_reference"]=>
      string(5) "local"
      ["rewrite_short_tags"]=>
      bool(false)
      ["proxy_ips"]=>
      string(0) ""
      }
      ["is_loaded"]=>
      array(0) {
      }
      ["_config_paths"]=>
      array(1) {
      =>
      string(33) "/www/users/H10044964/application/"
      }
    }
}
}


saturn_meeno 发表于 2016-5-4 19:51:19

遇到同样问题,麻烦楼主说下解决方案

Michael锐生 发表于 2016-5-5 10:49:54

文件名称大小写的问题?
页: [1]
查看完整版本: 发布到空间时,$RTR中的Class=""导致404