default php web server,PHPStorm Please configure PHP Interpreter to use built-in web server

This tutorial describes how to make use of the built-in webserver in PhpStorm.

PhpStorm comes with a built-in webserver that serves up static content like HTML, JavaScript and CSS, as well as PHP.

1. Open a project in PhpStorm

To be able to work with the built-in webserver in PhpStorm, a project has to be open. Make sure that the project has a PHP Interpreter configured under Settings / Preferences | Languages & Frameworks | PHP:

0818b9ca8b590ca3270a3433284dd417.png

2. Open a web browser

The easiest way to open the file from PhpStorm project is invoking Open in Browser | Browser ... action in the file context menu (in Project View toolbox) or in the View | Open in Browser | Browser ... menu:

0818b9ca8b590ca3270a3433284dd417.png

Alternatively, you can just navigate to http://localhost:63342/. For example when working in a project called HelloWorld, navigate to http://localhost:63342/HelloWorld/. This will serve our project files using the project root as the webserver's content root.

0818b9ca8b590ca3270a3433284dd417.png

Debugging using built-in webserver

Built-in webserver behaves like a normal webserver, which means that it can be used for proper PHP debugging. Please make sure that either Xdebug or Zend Debugger debug extension is installed and configured for the PHP interpreter set for the project.

Debugging using the built-in webserver is the same as normal debugging described in Zero-configuration Web Application Debugging with Xdebug tutorial and other debugging tutorials.

(optional) Built-in webserver configuration

Built-in webserver port can be always configured in Settings/Preferences | Build, Execution, Deployment | Debugger. The default port is 63342. Built-in webserver can also accept external connections when explicitly configured to do so (disabled by default due to security reasons).

0818b9ca8b590ca3270a3433284dd417.png

I'm getting an error: PHP Interpreter is not configured

When opening the browser and navigating to the project, an error may occur:

0818b9ca8b590ca3270a3433284dd417.png

This error is displayed when you navigate to the built-in webserver and no PHP interpreter has been specified for the project. By clicking the link in the error message or by using Settings/Preferences | Languages & Frameworks | PHP, the PHP interpreter can be specified.

0818b9ca8b590ca3270a3433284dd417.png

来自:http://confluence.jetbrains.com/display/PhpStorm/Using+the+Built-in+Webserver+in+PhpStorm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值