无法使用路由系统显示php错误

时间:2014-02-17 17:17:37

标签: php .htaccess error-handling compiler-errors

我在我的网站中实现了一个简单的路由系统,现在我看不到任何php错误。在我将所有文件上传到服务器后,我花了太多时间来调试所有文件。

我的路由系统是这样的:

$slots = array(2,3,4,5,6);

$param = explode("/", stripslashes($_SERVER['REQUEST_URI']));
define('LANG',      isset($param[$slots[0]])?$param[$slots[0]]:''); $const_lang = LANG;
define('PAGE',      isset($param[$slots[1]])?$param[$slots[1]]:''); $const_page = PAGE;
define('MENU',      isset($param[$slots[2]])&&is_numeric($param[$slots[2]])?$param[$slots[2]]:0); $const_menu = MENU;
define('SUBMENU',   isset($param[$slots[3]])&&is_numeric($param[$slots[3]])?$param[$slots[3]]:0); $const_submenu = SUBMENU;
define('ID',        isset($param[$slots[4]])&&is_numeric($param[$slots[4]])?$param[$slots[4]]:0); $const_id = ID;

// LOAD PAGE
if(LANG != '' && elem_exists(LANG, $active_lang)){
    if(file_exists(PAGE.'.php') && is_readable(PAGE.'.php') && include(PAGE.'.php')){
        //include $page.'.php';
    }else{
        include 'home.php';
    }

}else{
    header("location:".BASE_URL."pt/"); 
}

我尝试过更改我的.htaccess文件:

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag  log_errors on
php_value error_log  /.../PHP_errors.log

我已尝试直接更改文件php.ini

; display_errors
;   Default Value: On
;   Development Value: On
;   Production Value: On

; display_startup_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: On

我已经尝试安装库来获取像PHP Error这样的php错误。

我在我的文件顶部设置了error_reporting(E_ALL);

毕竟当我在页面上出现php错误时,页面空白,没有一行代码。

0 个答案:

没有答案