博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Sublime Text 2 中运行 PHP
阅读量:5950 次
发布时间:2019-06-19

本文共 1380 字,大约阅读时间需要 4 分钟。

hot3.png

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 system menu-tools

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.

sublime-build-php

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

转载于:https://my.oschina.net/lujian863/blog/182621

你可能感兴趣的文章
聊一聊PV和并发
查看>>
ASCII码表
查看>>
Maven的作用总结
查看>>
設置Linux保留物理內存並使用 (1)
查看>>
Android画一条横线
查看>>
CLOSE_WAIT?项目上线之际遇到这样的烦心事
查看>>
[LeetCode] Nth Digit 第N位
查看>>
通过request读取所有参数
查看>>
JQuery------Select标签的各种使用方法
查看>>
微信开发第7章 通过accesstoken获取用户黑名单列表
查看>>
Vue.2.0.5-Class 与 Style 绑定
查看>>
Java多线程 5 多线程其他知识简要介绍
查看>>
【 Gym - 101138K 】 The World of Trains (DP)
查看>>
kibana显示报错
查看>>
一些关于大数据的总结
查看>>
ONVIFclient搜索设备获取rtsp地址开发笔记(精华篇)
查看>>
关于spring-data-jpa的排序问题
查看>>
水滴状的自己定义视图,让您摆脱单调的Dialog
查看>>
名不正则言不顺,言不顺则事不成
查看>>
zookeeper 四字命令的使用
查看>>