Syntax check

  1. Scenario
  2. Solution

Scenario

So I've been busy making lots of modifications to my views/models/controllers - came to test the app and got a blank screen. Nothing in the application.log file so must be a syntax error somewhere... But which file?

Solution

If you are using linux (Ubuntu in my case) and have php locally, then run the following from a terminal from the protected directory

find . -name \*.php -exec php -l "{}" \;

This will syntax check each php file recursively from the current directory.

Full credit to http://www.electrictoolbox.com/php-command-line-syntax-checking/

4 0
2 followers
Viewed: 9 474 times
Version: 1.1
Category: Tips
Tags: php, syntax
Written by: Russell England
Last updated by: Russell England
Created on: May 4, 2011
Last updated: 6 years ago
Update Article

Revisions

View all history

Related Articles