0
votes

I installed SublimeLinter for sublime text 3. After install i add the following code in my user settings

 "sublimelinter": true,
        "sublimelinter_executable_map": {
            "php": "D:/xampp/xampp/php/php.exe"
        },

but php code not linting. Thanks for help!

2
check the console, maybe one of your rules is bad - taminov

2 Answers

2
votes

Please read the entire SublimeLinter documentation, especially the sections on installation and settings. SublimeLinter itself is only a framework for linters. The linters themselves are distributed as independent Sublime Text 3 plugins.

For PHP, the most popular linter is SublimeLinter-php, which uses php -l for linting. Install it via Package Control, then read through the settings documentation for full details on how to configure the linter. I'm not sure where you got the settings you mentioned in your question, but they are incorrect. If you open Preferences -> Package Settings -> SublimeLinter -> Settings-User you'll find that most of the settings are already there. The documentation describes how to set the path to php.exe, and set everything else up. The initial setup process does take some time, but performed correctly you shouldn't have any issues going forward.

1
votes

Just to help if someone have the same problem. I made it work this way (Sublime Text 3):

  1. Go to Preferences > Package Settings > Sublime Linter > Settings
  2. Add this code on Settings-User with your php.exe path

// SublimeLinter Settings - User
{
    "paths": {
        "windows": ["C:\\wamp\\bin\\php\\php7.2.14"]
    }
}

For example if you're using wamp with php7.2.14

Take a look at the documentation site