Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Dec 082010

Validate the syntax of PHP files in a directory


To validate the syntax of PHP files in a directory, to check if any syntax error so we can fix them before they really happen at runtime.

You would need to have the GNU parallel installed in order to use the command below.

# find -type f -name '*.php' | parallel php -l

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>