我是靠谱客的博主 微笑麦片,最近开发中收集的这篇文章主要介绍sublime2 php,Sublime Text 2 中运行 PHP,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Sublime Text 2 has the concept of build systems. This basically means that if you are editing a Python file then you can run the Python interpreter on the source file your are editing and see the output in a console window, all without having to leave the Sublime editor. It’s surprising how much quicker and easier this is compared to having to leave Sublime to swap to a separate console window.

This is Sublime’s Tools->Build System menu

b78a0ccd1cec60082dec877becfdd22c.png

Surprisingly, there is no supplied build system for PHP, to add one go to “New Build System”. A new tab opens for file untitled.sublime-build with the following in it:

{ “cmd”: [“make”] }

Delete that and replace it with this:

{ “cmd”: [“php”, “$file”], “file_regex”: “php$”, “selector”: “source.php” }

And save the file. Sublime will pop up the file save dialog, which defaults to the directory that Sublime uses for its user-generated config files, so don’t change the directory, just save this file as php.sublime-build. Now, when you edit a file whose name ends with php (as specified by the “php$” regex in the config file) you will have a build system available. You can now hit CTRL+B and the PHP interpreter will run against your source file and the output appears in a Sublime Text window.

6e7eec46252217464886ca06cef554f6.png

The grey window shows the output of the PHP interpreter and the time it took to run.

最后

以上就是微笑麦片为你收集整理的sublime2 php,Sublime Text 2 中运行 PHP的全部内容,希望文章能够帮你解决sublime2 php,Sublime Text 2 中运行 PHP所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(72)

评论列表共有 0 条评论

立即
投稿
返回
顶部