For PHPStorm, I have opened a project/site at location C:\site. Then, I went ahead and added a built in PHP Webserver at localhost port 8081 from the Menu Bar: Run > Edit Configurations.
To view index.php file, when I click on View > Open in Browser > Chrome (or any other browser), it takes me to http://localhost:63342/site/index.php
So, looks like it created another server running at port 63342? Also, it has the path as /site/index.php instead of just /index.php.
Is there a way to configure so that when I click view > open in browser > browser_name, it will take to localhost:8081/index.php?
Also, is it possible to turn off that server running at 63342 port?
Version: I am trying on PHPStorm 8 and 9 and both show same behavior.
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:
Settings (Preferences on Mac) | Build, Execution, Deployment | Deployment
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With