I can\'t do something like this ?
try {
require_once( \'/includes/functions.php\' );
}
catch(Exception $e) {
echo \"Message : \" . $e->g
As you can read here : (emph mine)
require() is identical to include() except upon failure it will also produce a fatal E_COMPILE_ERROR level error. In other words, it will halt the script
This is about require, but that is equivalent to require_once(). This is not a catchable error.
By the way, you need to enter the absolute path, and I don't think this is right:
require_once( '/includes/functions.php' );
You might want something like this
require_once( './includes/functions.php' );
Or, if you're calling this from a subdir or from a file that is included in different dirs, you might need something like
require_once( '/var/www/yourPath/includes/functions.php' );