Sublime Text 3配置php语法错误提示插件的方法:首先下载sniffer插件安装包;然后下载插件并放到php.exe安装目录里;接着设置都改成本地环境下的php安装路径;最后保存,重启Sublime Text 3即可。
Sublime Text 3配置php语法错误提示插件的方法:
第一步:下载php code sniffer插件安装包
解压安装包得到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.pear.php.net/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'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程序,语法错误提示如下图:
相关学习推荐:PHP编程从入门到精通
以上是Sublime Text 3如何配置php语法错误提示插件?的详细内容。更多信息请关注PHP中文网其他相关文章!

本文比较了酸和基本数据库模型,详细介绍了它们的特征和适当的用例。酸优先确定数据完整性和一致性,适合财务和电子商务应用程序,而基础则侧重于可用性和

本文讨论了确保PHP文件上传的确保,以防止诸如代码注入之类的漏洞。它专注于文件类型验证,安全存储和错误处理以增强应用程序安全性。

本文讨论了在PHP中实施API速率限制的策略,包括诸如令牌桶和漏水桶等算法,以及使用Symfony/Rate-limimiter之类的库。它还涵盖监视,动态调整速率限制和手

本文讨论了使用password_hash和pyspasswify在PHP中使用密码的好处。主要论点是,这些功能通过自动盐,强大的哈希算法和SECH来增强密码保护

本文讨论了OWASP在PHP和缓解策略中的十大漏洞。关键问题包括注射,验证损坏和XSS,并提供用于监视和保护PHP应用程序的推荐工具。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

记事本++7.3.1
好用且免费的代码编辑器

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

WebStorm Mac版
好用的JavaScript开发工具

SublimeText3 Linux新版
SublimeText3 Linux最新版