700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > Sublime Text 3如何配置php语法错误提示插件?

Sublime Text 3如何配置php语法错误提示插件?

时间:2021-06-05 08:57:43

相关推荐

Sublime Text 3如何配置php语法错误提示插件?

后端开发|PHP问题

sublime,php,错误

后端开发-PHP问题

dnf外挂源码,vscode样式写在,ubuntu最新手机,检验tomcat正确,sqlite可以增值吗,js应用于手机的lightbox插件,什么是微前端框架,爬虫如何解析,php 数据函数,陕西SEO优化简历,网站邮件系统源码,浪漫表白网页源码,织梦最新淘宝客模板下载地址,java旅游页面设计代码,基于jsp的物流管理系统,付费阅读小程序1.8.2lzw

Sublime Text 3配置php语法错误提示插件的方法:

洛奇源码,vscode私有源,ubuntu系统能装文华财经吗,tomcat 禁止访问,sqlite3 cout,zblog地图插件,腾讯用的什么前端框架,爬虫机器人制造,订餐系统 php,黄山歙县seo,168的网站,网页设计的垂直导航栏,保健品 网站模板,易语言制作程序软件lzw

第一步:下载php code sniffer插件安装包

html购物车源码,vscode怎么打开html,ubuntu设置wf,tomcat设置初始界面,寄养爬虫,php pdo设置,山东seo优化诚信经营,合同管理网站源代码,五二模板lzw

解压安装包得到sublime-phpcs-master,把sublime-phpcs-master文件夹放到sublime安装目录下的Data/Packages/目录下;

重启sublime, 打开Sublime Text 3->Preferences->Package Settings -> Php Code Sniffer 证明插件安装成功;

第二步:下载php-cs-fixer.phar

第三步:把php-cs-fixer.phar 放到你的 php.exe 安装目录 (例如(mine is C:/WAMP/php/php.exe));

第四步:下载 http://download./package/PHP_CodeSniffer-1.5.0RC4.tgz,解压,然后找到scripts目录下的phpcs.bat,放到php.exe 安装目录;

第五步:解压打开,在子文件example-settings下有个文件

windows-7-phpcs-fixer-linter.example就是Sublime Text 3 在windows7配置 PHPCS 的样例,还有一个nix-all-commands.example是在linux/unix环境下的配置样例

第六步:以下就是windows-7-phpcs-fixer-linter.example的配置内容,打开你的Sublime Text 3->Preferences->Package Settings -> Php Code Sniffer -> Settings – User ,复制windows-7-phpcs-fixer-linter.example的内容到配置文件phpcs.sublime-settings,然后修改对应的php.exe路径

设置都改成你本地环境下的php安装路径,保存,重启Sublime Text 3

{// Path to php on windows installation// This is needed as we cannot run phars on windows, so we run it through php"phpcs_php_prefix_path": "C:\\wamp\\bin\\php\\php5.4.12\\php.exe",// This is the path to the bat file when we installed PHP_CodeSniffer"phpcs_executable_path": "C:\\wamp\\bin\\php\\php5.4.12\\phpcs.bat",// PHP-CS-Fixer settings// Don want to auto fix issue with php-cs-fixer"php_cs_fixer_on_save": false,// Show the quick panel"php_cs_fixer_show_quick_panel": true,// The fixer phar file is stored here:"php_cs_fixer_executable_path": "C:\\wamp\\bin\\php\\php5.4.12\\php-cs-fixer.phar",// PHP Linter settings// Yes, lets lint the files"phpcs_linter_run": true,// And execute that on each file when saved (php only as per extensions_to_execute)"phpcs_linter_command_on_save": true,// Path to php"phpcs_php_path": "C:\\wamp\\bin\\php\\php5.4.12\\php.exe",// This is the regex format of the errors"phpcs_linter_regex": "(?P.*) on line (?P\\d+)",// PHP Mess Detector settings// Not turning on the mess detector here"phpmd_run": false,"phpmd_command_on_save": false,"phpmd_executable_path": "","phpmd_additional_args": {}}

重启Sublime Text 3,打开php程序,语法错误提示如下图:

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。