To find syntax errors in all php pages within a directory called /var/www/html, use the following command:
find /var/www/html -name '*.php' -type f -exec php -l {} \;
To find syntax errors in all php pages within a directory called /var/www/html, use the following command:
find /var/www/html -name '*.php' -type f -exec php -l {} \;