Install SublimeLinter-php on Windows

Daniel Uncategorized 5 Comments

I like to work with Sublime Text because of the many packages and simplicity. You can customize the applications in almost any way possible: color schemes, packages, settings and short cuts. And with the plugin SublimeLinter-php it is even possible to see your PHP errors before you save and run the file!

I had recommended Sublime to my colleague, however he is working on Windows which does not provide PHP out-of-the-box. And this is required for the SublimeLinter-php plugin to work. Even when you have installed it, it may not work. Therefore I have written this short tutorial how you can make the plugin work at your Windows computer. Mac users: You only have to follow step 3 through 7. By default, the Mac is friendly for this plugin.

Installation steps:

  1. Download the desired PHP version: http://windows.php.net/download/
  2. Unzip the files into C:/PHP/
  3. Open Sublime.
  4. Press CTRL+SHIFT+P
  5. Enter  Install Package and choose Package Control: Install Package
  6. Enter SublimeLinter and click on enter to install.
  7. Do the same in step 5 and 6 for the package SublimerLinter-PHP.
  8. Open Preferences -> Package Settings -> SublimeLinter -> Settings – User
  9. Change in the paths key “windows”: [] to “windows”: [“C:/PHP/”]
  10. Save the file and restart Sublime.

Congratulations! SublimeLinter-php also works for you now (make sure you set the syntax to PHP). How can you find this error?:

  1. Install the packages.
  2. Enable debug output (Tools -> SublimeLinter -> Debug Mode)
  3. Restart Sublime.
  4. Press CTRL+`
  5. You can see all the debug  information including the following error:
    SublimeLinter: cannot locate 'php'

Comments 5

  1. “Congratulations! SublimeLinter-php also works for you now. ”
    Sorry to rain on your parade, but your directions do not work.
    Instead of installing PHP I am using path to php in my XAMPP.
    Should work, but guess what …
    Did you actually installed linter and it worked for you?

    1. :))
      You know, gods of internet sometimes ‘piss’ on us poor coders;))
      I hope my ‘wholesome’ way of writing does not offend your senses.
      As too linter, I just tried something to make linter work and … and it worked.
      You know what was that?
      I made sure that my php file had syntax set to php.
      ctrl+shift+p ->set syntax: php
      Sorry for previous email.
      Jeff

      1. Post
        Author

        Hi Jeff,

        I am happy that you have resolved the problem. I have updated the article to make sure that others will not have this problem.

        Ps I did test it on Windows since a colleague had this issue and it worked like a charm 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *