Skip to content

Instantly share code, notes, and snippets.

@onfire4g05
Created September 17, 2014 20:37
Show Gist options
  • Save onfire4g05/2927dcaf38c3ba30ae91 to your computer and use it in GitHub Desktop.
Save onfire4g05/2927dcaf38c3ba30ae91 to your computer and use it in GitHub Desktop.
Find Invalid PHP

Find parse errors in php code inside directory

Windows

Find-ChildItem -name .php -exec "c:\xampp\php53\php -l '{}' \;" > c:\xampp\htdocs\test.txt

No syntax errors detected(.*)$\r\n

Linux

find -name '*.php' -exec php -l '{}' \; | grep -v 'No syntax' > ~/php-errors.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment