I have been playing with this for over an hour to get the sublimelinter working.
So I now have the following packages installed:
SublimeLinter
SublimeLinter-php
SublimeLinter-phplint
Does someone know why it still does not lint the PHP I write?
I am working on Windows and cannot find any docs relating to sublime 3 and windows.
The console reads:
SublimeLinter: cannot locate 'phplint'
SublimeLinter: cannot locate 'php'
I had the same problem and FINALLY figured out, how to get SublimeLinter to work in SublimeText 3. After installing SublimeLinter
and SublimeLinter-php
it kept telling me SublimeLinter: cannot locate 'php'
. (No surprise, PHP isn't in my PATH
on purpose).
After adding the path of my PHP installation to the SublimeLinter User Settings (Preferences -> Package Settings -> SublimeLinter -> Settings - User), and a restart of SublimeText everything is working as expected now.
Here is the relevant part:
"paths": {
"linux": [],
"osx": [],
"windows": [
"C:/Program Files (x86)/PHP/php-5.4/"
]
},
I didn't have to change anything else.
I encountered the same issue on Windows with the SublimeLinter-php independent linter plugin for the widely rewritten SublimeLinter 3:
WARNING: php deactivated, cannot locate 'php'
I solved it too by just adding the relevant PATH
(with double backslashes!) in SublimeLinter 3 "extra pathes" user setting (vs. other method/choice i.e. directly editing the Windows PATH
environment variable), so that the executable’s directory is available to SublimeLinter:
"paths": {
"linux": [],
"osx": [],
"windows": [
"C:\\xampplite\\php\\"
]
}
It's really worth noting that you must provide the directory that will be searched, not the direct path to the executable; it took me a while to figure this out, since the corresponding SublimeLinter setting in Sublime Text 2 must on the contrary include the executable; in my case:
"sublimelinter_executable_map":
{
"php": "C:\\xampplite\\php\\php.exe"
}
I was struggling with this as well but just got it working. You need to install phplint which you can download from http://www.icosaedro.it/phplint/download.html
Open up the zip and copy phplint.exe and phpl.bat to your php directory (mine is c:/wamp/bin/php/php5.3.13/)
You also need to have the path to php in your windows path which you can find by right clicking on 'my computer' and properties -> advanced system settings -> environment variables -> system variables -> path Add the path on the end separated by a ; mine was as above C:\wamp\bin\php\php5.3.13 if you want to use node for js hinting then add the path to node here as well.
I think the linters now get added automatically but you can check in the file:
Preferences -> Package Settings -> SublimeLinter -> Settings - User
Mine looks like this (the relevant parts. If the file is blank copy the contents of the default settings file)
"lint_mode": "background",
"linters": {
"csslint": {
"@disable": false,
"args": [],
"errors": "",
"excludes": [],
"ignore": "",
"warnings": ""
},
"htmltidy": {
"@disable": false,
"args": [],
"excludes": []
},
"jshint": {
"@disable": false,
"args": [],
"excludes": []
},
"php": {
"@disable": false,
"args": [],
"excludes": []
},
"phplint": {
"@disable": false,
"args": [],
"excludes": []
}
},
"mark_style": "outline",
If you then restart it should start linting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With