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

来源:互联网 发布:如何培养编程思维 编辑:程序博客网 时间:2024/06/17 13:58

 

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 underSettings / Preferences | Languages & Frameworks | PHP:

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 (inProject View toolbox) or in the View | Open in Browser | Browser ... menu:

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


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 eitherXdebug 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 is63342. Built-in webserver can also accept external connections when explicitly configured to do so (disabled by default due to security reasons).

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

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

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 usingSettings/Preferences | Languages & Frameworks | PHP, the PHP interpreter can be specified.

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

0 0
原创粉丝点击