Sublime Text 3配置php语法错误提示插件PHPCS (windows7环境)
2014-06-17 18:45
676 查看
第一步:下载php code sniffer插件安装包 地址 https://github.com/benmatselby/sublime-phpcs;
解压安装包得到sublime-phpcs-master,把sublime-phpcs-master文件夹放到sublime安装目录下的Data/Packages/目录下;重启sublime, 打开Sublime Text 3->Preferences->Package Settings -> Php Code Sniffer 证明插件安装成功;
第二步:下载php-cs-fixer.phar 地址 http://cs.sensiolabs.org/get/php-cs-fixer.phar ;
第三步:把php-cs-fixer.phar 放到你的 php.exe 安装目录 (例如(mine is C:/WAMP/php/php.exe));
第四步:下载 http://download.pear.php.net/package/PHP_CodeSniffer-1.5.0RC4.tgz,解压,然后找到scripts目录下的phpcs.bat,放到php.exe 安装目录;
第五步:解压打开 第一步下载的php code sniffer安装包,在子文件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
重启Sublime Text 3,打开php程序,语法错误提示如下图:
其实我一直用Zend Studio,感觉Sublime Text 3挺好的,小巧,插件多,没错误提示不爽就找了找怎么装插件。把安装过程写下来了,感谢http://www.cnblogs.com/meetrice/p/3731635.html这篇博客的指导
解压安装包得到sublime-phpcs-master,把sublime-phpcs-master文件夹放到sublime安装目录下的Data/Packages/目录下;重启sublime, 打开Sublime Text 3->Preferences->Package Settings -> Php Code Sniffer 证明插件安装成功;
第二步:下载php-cs-fixer.phar 地址 http://cs.sensiolabs.org/get/php-cs-fixer.phar ;
第三步:把php-cs-fixer.phar 放到你的 php.exe 安装目录 (例如(mine is C:/WAMP/php/php.exe));
第四步:下载 http://download.pear.php.net/package/PHP_CodeSniffer-1.5.0RC4.tgz,解压,然后找到scripts目录下的phpcs.bat,放到php.exe 安装目录;
第五步:解压打开 第一步下载的php code sniffer安装包,在子文件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't 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<message>.*) on line (?P<line>\\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程序,语法错误提示如下图:
其实我一直用Zend Studio,感觉Sublime Text 3挺好的,小巧,插件多,没错误提示不爽就找了找怎么装插件。把安装过程写下来了,感谢http://www.cnblogs.com/meetrice/p/3731635.html这篇博客的指导
相关文章推荐
- Sublime Text 3配置php语法错误提示插件PHPCS (windows7环境)
- Sublime Text 3配置php语法错误提示插件PHPCS(windows 7)
- Sublime Text 3配置php语法错误提示插件PHPCS
- Sublime Text 3配置php语法错误提示插件PHPCS
- windows7上用IIS配置PHP网站,提示如下错误:
- sublime 支持php语法错误提示的插件
- Sublime Text 3(全插件)配置和php5.5调试环境
- sublimelinter phpfmt php代码语法错误提示 代码缩进整理 插件自动删除没有引用的代码片段,解决办法
- 在linux环境下,php语法出错,怎样让php编译后提示编译错误
- LNMP环境下配置PHP错误信息提示
- <h1>读取配置文件失败</h1>这通常意味着文件中有语法错误,请检查下面显示出的错误。<br /><br /><iframe src="show_config_errors.php" />
- Sublime Text 3 配置 PHPCS 插件
- PHP配置环境搭建 MyEclipce添加PHP插件
- 在安装phpmyadmin出现错误,提示缺少 mysqli 扩展。请检查 PHP 配置解决方案
- 关于Sublime text 的PHP编译环境配置的问题
- Windows7下使用IIS7与FastCGI模块配置PHP5.3.1运行环境
- 转载--开启 PHP 错误提示配置步骤详解
- PHP配置(错误提示)
- 配置php网页显示各种语法错误
- 为 Sublime Text 3059 配置 PHP 编译环境