After an unsuccessful attempt at installing SublimeLinter months ago, I decided to give it another go. SublimeLinter is a syntax checker package for SublimeText and allows for auto syntax checking.
You need the Package Control plugin first to automate the installation and upgrading of plugins. Follow the instructions on the Installing section of SublimeLinter page to install it.
From here, PHP linting did not work for me.
After searching online, 2 fixes on Stack Overflow worked for me:
1. Set the syntax type for PHP files to PHP instead of HTML5
- View->Show Console and paste: sublime.active_window().active_view().settings().get('syntax')
- If this doesn't 'Packages/PHP/PHP.tmLanguage' go to View->Settings->Syntax->Open all current extensions as... -> PHP
- SOURCE: http://stackoverflow.com/questions/11817164/sublimelinter-php-linting-not-working
2. Point SublimeLinter to your PHP exe:
- Set your PC PATH environment variable e.g. C:\xampp\php, then update the SublimeLinter executable map by:
- Preferences -> Package Settings -> SublimeLinter -> Settings-Default
- In "sublimelinter_executable_map", enter "php":"php" between the { and }
After this, SublimeLinter highlights any PHP syntax errors automatically :-)
No comments:
Post a Comment