문제

is there a way to check by using a command into terminal,recursively into folders, if a PHP file is corrupted? Thank you very much.

In my case, for corruption i mean bad encoding that could create problems with PHP interpreting.

도움이 되었습니까?

해결책 2

Problem was caused by the Byte Order Mark in my files. Used this answer to fix everything Elegant way to search for UTF-8 files with BOM?

다른 팁

What do you mean by corrupted? I assume you mean syntax error?

You can check for syntax errors in a terminal with:

php -l file.php

You can use find to search recursively and check all php files:

find . -type f -name '*.php' -exec php -l {} \;

Hope this helps :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top