In Sublime Text, go to Preferences -> Browse packages.

Go to the PHP folder and create an empty file PHP.sublime-build.

Edit this file and enter :

1
2
3
4
5
{
"cmd": ["php", "-l", "$file"],
"selector": "source.php",
"file_regex": "^Parse error: .* in (.*?) on line ([0-9]*)"
}

Now, when editing a .php file, press Cmd+B to run php-l on your file and check for syntax error

 

Filed under: Mac OS X

Tagged with: , , ,

Liked this page?

Tweet it

Subscribe to the RSS feed or sign up for the newsletter now.

Posts related to Sublime Text : check PHP syntax on build

Name (required)

Email (required)

Website

Leave a Reply

  • About Me


    photo of Samantha Halfon Samantha Halfon
    Software Engineer
    blueKiwi software
    Paris, France
    I enjoy playing with my computer(s), listening to Bob Dylan (and related artists) and watching movies (especially if they were directed by Martin Scorsese or John Cassavetes). Sometimes, I play a little guitar... If not doing any of the above, I am either riding a small red bike around Paris, or, making videos. About my videomaking please check out World Wide Angle and its blog.