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'