PHP linting is not working in SublimeLinter though it says PHP: loaded
in the console. I'm working on Windows. Additionally, there are no options if I open the Command Palette except for Extract Annotations
. Did anyone have the same problem and knows the solution?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Additionally, make sure you've given the path to php.exe in your user settings -
(prefs>pkg settings>sublimelinter>settings - user)
should look like this (if your path is "C:\xampp\php\php.exe"):
{ "sublimelinter": true, "sublimelinter_executable_map": { "php":"/xampp/php/php.exe" } }
For windows I did this and it worked, use \\ and it should work!
I just had the same issue. The cause for my problem was that all PHP files where opened with the HTML5 syntax. You can check the current syntax by pasting the following command in your SublimeText console:
To set php as a default for the current file type, you can go to: view > syntax > Open all current extensions as... > php
Hope this helps!
on MAC OS X in sublimeText 2 once you have installed sublimelint package
cmd+shift+p
to open command palette then enter or selectPreferences:SublimeLint - User
This will open the setting file
Paste this exactly:
Save the file and restart sublime text 2. if you have an error such as it could not read the file, it's because you made a typo mistake. The setting file it must be a correctly formatted json.
if you have any problems do a
which php
in your terminal to be sure php is installed at/usr/bin/php
and replace the path by what thewhich
command gives you if it's different.i sovle this problem by change setting (where are bold) ,then restart sublime and try this php code to see sublime linter error
//not put semicolon you see red dot on next line of php code
just change setting like below
this two must change
I had to use this in my user settings: