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.