dqlxtv1452 2014-02-17 17:17
浏览 102

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

I've implemented a simple routing system in my site and now I can't see any php errors. I've spent too much time trying to debug all my files after I've uploaded them into the server.

My routing system is like this:

$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/"); 
}

I've tried changing my .htaccess file like this:

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

I've tried changing the file php.ini directly:

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

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

I've tried installing libraries to get php errors like PHP Error.

I've set up error_reporting(E_ALL); at the top of my files.

And after all that when I have a php error on a page, the page comes blank without a single line of code.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
    • ¥50 需求一个up主付费课程
    • ¥20 模型在y分布之外的数据上预测能力不好如何解决
    • ¥15 processing提取音乐节奏
    • ¥15 gg加速器加速游戏时,提示不是x86架构
    • ¥15 python按要求编写程序
    • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
    • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
    • ¥15 opencv图像处理,需要四个处理结果图
    • ¥15 无线移动边缘计算系统中的系统模型