Run PHP in SublimeText)

Source: Internet
Author: User
SublimeText run PHP (to) SublimeText2hastheconceptofbuildsystems. ThisbasicallymeansthatifyouareeditingaPythonfilethenyoucanrun Sublime Text to run 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? Separate? Console window. this is Sublime's Tools-> Build System menuSurprisingly, 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?Php. sublime-build. Now, when you edit a file whose name ends?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. The gray window shows the output of the PHP interpreter and the time it took to run.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.