-
Download PHP 5.4.0
or higher.
- Register the downloaded PHP 5.4.0 interpreter in IntelliJ IDEA.
- Open your project.
- Appoint the PHP 5.4.0 interpreter configuration for use in the project.
-
Open the Run/Debug Configuration dialog box by doing one of the following:
- On the main menu, choose .
- Press Alt+Shift+F10Alt+Shift+F10, then press 00 to display the Edit Configuration dialog box or select the configuration from the pop-up window and press F4F4.
-
Click
on the toolbar or press InsertInsert.
From the drop-down list, select the PHP Built-in Web Server configuration type.
The PHP Built-in Web Server dialog box opens.
- Specify the configuration name.
-
Specify the server connection settings:
- In the Host text box, type localhost.
- In the Port text box, type the port number the server will listen to. The default port number ir 80.
-
Specify the folder that will be considered server document root
.
The folders that are under this document root in the project tree will be submitted to the PHP interpreter.
The server document root folder will be accessed through HTTP at the above specified host:port.
In the Document root text box, specify the path to the relevant folder. This can be the project root or any other folder under it.
Tip
Optionally, customize the run configuration:
- To have a specific script always executed upon the server start-up, select the Use router script check box and specify the path to the script in the text box.
- To customize the behavior of the current PHP interpreter, in the Command Line area specify the options and arguments to be passed to the PHP executable file.
-
Run the application. To do that, select the built-in Web server run configuration
from the Run/Debug Configuration drop-down list on the main tool bar, and then click the Run button
.
-
Launch the browser of your choice and open the starting page of your application by typing its URL address in the following format:
http://localhost:<port>/<path to the required file relative to the server document root>
