Home Download Buy Blog Forum Support

PHP Syntax Checking

PHP Syntax Checking

Postby andrewteg on Wed Nov 07, 2012 4:21 pm

I'm new to Sublime and trying it out and so far so good. I have been looking for a way to add Syntax Checking for PHP, and hopefully Javascript/JQuery, CSS, and HTML too. I have installed Package Control and found both "SublimeLinter" and "PHP Code Sniffer" but cannot seem to get either one to show me errors. I did get SublimeLinter to show annotations (TODO) so I believe I am installing them correctly but not sure what I'm doing wrong at this point. I have this code and am hoping to see a warning or something in the line numbering gutter about the various errors. Any ideas?
Code: Select all
if ($x=1)
   'yes';
}

Thanks,
Andrew
andrewteg
 
Posts: 2
Joined: Wed Nov 07, 2012 4:12 pm

Re: PHP Syntax Checking

Postby svenax on Thu Nov 08, 2012 10:39 am

You have one actual error in that code snippet, and SublimeLinter shows me that just fine. (The unmatched bracket.) Do you get any messages in the console indicating that there might be problems?
svenax
 
Posts: 154
Joined: Tue Dec 20, 2011 12:47 pm

Re: PHP Syntax Checking

Postby andrewteg on Fri Nov 09, 2012 4:15 pm

Thanks for the reply. I do not get anything in the console and in fact just went through https://tutsplus.com/lesson/sublime-linter/ (found from the @sublimehq Twitter feed) and did not get anything when doing the tutorial.

I did notice at about 1:55 he goes to Command Pallette and has a ton of SublimeLinter options. My only option is to Extract Annotations so I believe that has something to do with it but I don't know how to get all the SublimeLinter options.

FWIW, I am using Win7 and the Unregistered version since I'm still trying out ST2. The only other issue I've had is changing the theme so I'm not sure if there are some things that don't work until you register or what, but didn't see anything mentioning that.

Thanks,
Andrew
andrewteg
 
Posts: 2
Joined: Wed Nov 07, 2012 4:12 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 23 guests