Sublime text3 runs the file (php) on the local server (localhost) on the specified browser ),

Source: Internet
Author: User

Sublime text3 runs the file (php) on the local server (localhost) on the specified browser ),

When I used sublime text3 yesterday, I found that I could run the PHP file on the local server. So Baidu gave me some related knowledge,

I finally succeeded. Let's summarize it today.

First, let the sublime text3 appear in the sidebar bar on the sidebar. Baidu is not allowed. I will not repeat it here (mainly lazy ).

Then, start to create a project. The process is as follows.

First, create a project directory in the local disk. For example, I created the mismatch folder under D: \ AppServ \ www,

Mismatch is my project name, which contains three directories and an index. php file.

In sublime text3, locate project-> add folder to project and select the mismatch directory. The project appears on the sidebar.

Right-click mismatch (project)-> project-> edit previes urls,

Edit the following content in the json file:

{
"D:/AppServ/www/mismatch /":{
"Url_testing": "http: // localhost:/mismatch /",
"Url_production ":""
}
}

After saving, click preferences> package settings> side bar> key bindings-user in the menu bar to edit the following content:

[
{

"Keys": ["ctrl + r"],
"Command": "side_bar_open_in_browser ",
"Args ":{
"Paths": [],
"Type": "testing ",
"Browser": "chrome"
}
}
]

Note that brackets cannot be saved. Click Save.

Note: The content of keys is the bound key. My keys are ctrl + r,

The content of browser is the default browser. What should I do if the content of browser is filled in? Follow these steps,

Click preferences-> package settings-> side bar-> setting default-> to view

"Default_browser": "", // one of this list: firefox, chrome, canary, chromium, opera, safari, ie

Then we can select the specified browser, such as chrome,

In the index. php file, press ctrl + r to open the PHP file in chrome.

If you have any errors or deficiencies, please correct them.

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.