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.

Perform syntax check to PHP files

Answer:

To perform syntax check to PHP file, use the php command with -l option.

e.g.

#  php -l test.php
No syntax errors detected in test.php
  1. How to perform syntax check for Python program
  2. How to perform syntax check for Perl program
  3. How to perform syntax check on a bash script?
  4. Validate the syntax of PHP files in a directory
  5. How to check the Apache configuration file (httpd.conf)?

Leave a Reply

(required)

(required)

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>