PHPStorm: Open in Browser option: How to set default server to open?

时间秒杀一切 提交于 2019-12-04 05:58:45

http://localhost:63342/PROJECT_NAME/ is PhpStorm's own simple built-in web server in action. It is used if no Deployment entries are defined (or defined but non of them is marked as default for this project).

When you use Open in Browser action IDE checks your deployment settings looking for base URL that will be used to open such file in a browser. If it finds no such entries then instead of opening this file using file:// protocol it uses its' own built-in web server.

So .. to use your specific web server / URL you have to:

  1. Settings (Preferences on Mac) | Build, Execution, Deployment | Deployment
  2. Create new entry of appropriate type (or finish configuring already existing one, if you have done it already)
  3. Configure it (provide URL and paths) so that no warnings is shown for first 2 tabs (Connection & Mappings).
  4. Mark such entry as Default for this project

Now IDE will use those details when you use Open in Browser action.

NOTE: that Open in Browser action will not launch your web server (the one you have created for port 8081) -- it just opens URL in browser. You will have to make sure that your server is already running before using this action.


Useful links:

  1. Deployments in PhpStorm
  2. Using the Built-in Webserver in PhpStorm
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!