sublime text3配置php編譯環境
阿新 • • 發佈:2019-01-03
首先在Window環境安裝配置好執行環境(安裝PHP執行引擎),或者使用xampp整合環境
如圖(表示已經配置成功)
(2) 安裝 SublimeLinter 和 SublimeLinter-php 元件
Ctrl + Shift + P 喚醒後輸入:pic,開啟包管理檔案,然後輸入 sublimelinter,選擇選裝;然後再pic喚醒輸入:sublimelinter-php
安裝完外掛以後去配置一下外掛相關配置,在 Sublime Text 3選單開啟:Preferences -> Package Setting -> SublimeLinter -> Setting User,把如下內容填充進去:
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"annotations ": {
"@disable": false,
"args": [],
"errors": [
"FIXME"
],
"excludes": [],
"warnings": [
"NOTE",
"README",
"TODO",
"XXX" ,
"@todo"
]
},
"php": {
"@disable": false,
"args": [],
"excludes": []
},
"summitlinter": {
"@disable": false,
"args": [],
"excludes": [],
"globals": "",
"ignore": "channel",
"limit": null,
"only": ""
}
},
"mark_style": "outline",
"no_column_highlights_line": false,
"passive_warnings": false,
"paths": {
"linux": [],
"osx": [],
"windows": [
"c:\\xampp\\php"
]
},
"python_paths": {
"linux": [],
"osx": [],
"windows": []
},
"rc_search_limit": 3,
"shell_timeout": 10,
"show_errors_on_save": false,
"show_marks_in_minimap": true,
"sublimelinter": "save-only",
"sublimelinter_executable_map": {
"php": "c:\\xampp\\php\\php.exe"
},
"syntax_map": {
"html (django)": "html",
"html (rails)": "html",
"html 5": "html",
"javascript (babel)": "javascript",
"magicpython": "python",
"php": "php",
"python django": "python",
"pythonimproved": "python"
},
"warning_color": "DDB700",
"wrap_find": true
}
}
說明:注意裡面的兩個php路徑必須跟我們實際php指令碼引擎路徑一致。
(3) 儲存配置檔案後重啟Sublime編輯器,然後編輯任何php程式碼檔案,如果程式碼語法有錯誤都會及時提醒啦。