IntelliJ IDEA 13.1 Web Help

Some features described here are available in Ultimate edition only.

PHP support includes:

  • Possibility to create PHP files and classes from templates.
  • Full PHP 5.4 syntax support.
  • Syntax highlighting.
  • Error highlighting.
  • Basic on-the-fly code completion.
  • Resolution of include statements and file references, including references to PHAR archives.

    All the PHAR files from the current project and the specified include path are shown in the project tool window under the Project View/Libraries/PHAR node and available for browsing right there.

  • Class Completion.
  • Intention actions and quick fixes.
  • Surrounding with code constructs Ctrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JCtrl+Alt+JAlt Command JAlt Command JAlt Command J and Ctrl+Alt+TCtrl+Alt+TCtrl+Alt+TCtrl+Alt+TCtrl+Alt+TCtrl+Alt+T or Ctrl+Shift+CCtrl+Alt+TCtrl+Alt+TShift+Alt+Z or Ctrl+Alt+TAlt Command TAlt Command TAlt Command Z.
  • Code inspections.
  • Jump to declaration (Ctrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+Alt+G, Escape, Period, Alt+Period or Ctrl+Button1 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickF12, Shift+F2, Ctrl+B, Ctrl+Button1 Click or Button2 ClickCtrl+B, Ctrl+Button1 Click or Button2 ClickF3 or Ctrl+Button1 ClickCommand B, Command Button1 Click or Button2 ClickCommand B, Command Button1 Click or Button2 ClickF3 or Control Button1 Click).
  • Refactoring:
    • Rename (Shift+F6Shift+F6Shift+F6Shift+F6Shift+F6Shift+F6Shift+F6Ctrl+RShift+Alt+RShift F6Shift F6Shift F6).
    • Move (F6F6F6F6F6F6F6Ctrl+MShift+Alt+VF6F6Alt Command V).
    • Copy (F5F5F5F5F5F5F5F5F5F5F5F5.

Note

PHP coding assistance is provided via a bundled PHP plugin that is enabled by default. If not, activate it on the Plugins page of the Settings dialog box.

This part describes some procedures that are specific for developing PHP applications and some preliminary steps that are required to configure PHP development environment.

To develop an application using PHP

Follow these general steps:

  1. Configure the PHP development environment.
  2. Enable PHP support in IntelliJ IDEA.
  3. Start creating a project from scratch. On the first page of the New Project wizard, select Web Module.

    Tip

    To run and debug your application on a local Web server, create the project root below the Web server document root. Thus your application sources will be "visible" for the local Web server.

  4. Create and configure the required data sources.
  5. Populate the application using provided coding assistance.
  6. Deploy the application.

    Tip

    With IntelliJ IDEA, you can flexibly configure deployment of PHP applications. For example, you can set up your PHP project on a local Web server from the very beginning, or develop and test an application locally and then upload it to a remote Web server, etc.

  7. Run the application. You can do it in several ways:
    • From IntelliJ IDEA using a run configuration of the type PHP Web Application to view application output in a browser.
    • From IntelliJ IDEA using a PHP Console run configuration to view the application output in the Run tool window.
    • From IntelliJ IDEA, using a built-in Web server. This approach saves your time and effort because you do not need to deploy the application sources.

Tip

The following optional steps may be helpful:

See Also

Procedures:

Reference:

Web Resources: