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.