Par exemple :
nobody@SERVEUR:~$ cat file_with_syntax_error.php <?php ''
nobody@SERVEUR:~$ php file_with_syntax_error.php PHP Parse error: syntax error, unexpected end of file in /home/nobody/file_with_syntax_error.php on line 2
Avec le vérificateur de syntaxe php :
nobody@SERVEUR:~$ php -l file_with_syntax_error.php PHP Parse error: syntax error, unexpected end of file in file_with_syntax_error.php on line 2 Errors parsing file_with_syntax_error.php
php.ini : Gestion des erreurs : Constantes pré-définies
;error_reporting = E_ALL ;error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE
Ainsi, vous retrouverez dans vos logs :
PHP Parse error: syntax error, unexpected