I'am include
some files of my website by mvc.php
.
And I want that if there are errors in PHP code - user see my error page instead of exceptions.
I tried to catch errors with try/catch
, but include errors skips it
try {
include '../index.php';
} catch (Exception $e) {
include 'errors/error501.php';
}
return;
With ths code there is just an exception text of my corrupted file:
Parse error: syntax error, unexpected '/', expecting end of file in W:\domains\amelia.lc\dev\index.php on line 87
I tried to check file with php_check_syntax
, but this function were deleted from PHP
How can i solve it?