Built-in web server

Last modified: 19 January 2023

PhpStorm has a built-in web server that can be used to preview and debug your application. This server is always running and does not require any manual configuration. All the project files are served on the built-in server with the root URL http://localhost:<built-in server port>/<project root>, with respect to the project structure.

The built-in server can only serve static content like HTML, JavaScript and CSS. To use it with PHP files, you need a local PHP interpreter specified for your project. When the interpreter is configured, PhpStorm will automatically start the PHP Built-In Web Server and redirect all PHP requests to it as soon as you run your PHP application. To run your PHP application, either open a file in the browser or create a dedicated run/debug configuration and launch it.

If a Deployment server is defined for this project and marked as default, the file will be served from this server instead. If necessary, you can still open the page via the PhpStorm built-in web server. To do this, open the desired browser and type the URL of the file with respect to the project structure, using http://localhost:<built-in server port>/<project root> as the root URL.

You can also preview HTML and PHP files via the built-in preview in the dedicated editor tab.