This feature is supported in the Ultimate edition only.

Before you start, install and enable the PHP and Command Line Tool Support repository plugins on the Plugins page of the Settings / Preferences Dialog.

On this page:

Integrating an external PHP command line tool with IntelliJ IDEA

  1. Download and install the desired tool:
  2. Open the Command Line Tool Support page (File | Settings | Tools | Command Line Tool Support for Windows and Linux or IntelliJ IDEA | Preferences | Tools | Command Line Tool Support for macOS) , and click ../../Shared/add.png on the toolbar.
  3. In the Command Line Tools dialog that opens, choose the name of the tool from the list. In the Visibility area, specify how you want to use the tool:
    • To run the commands in the current project only, choose Project.
    • To run the commands in any IntelliJ IDEA project, choose Global.
  4. In the dialog box that opens, specify the path to the .xml descriptor of the chosen tool in the Path to <tool> text box. Depending on the chosen tool, specify the location of the following file:
    • <Zend-Framework-home>/zf.bat for Zend Framework 1.
    • <Zend-Framework-home>/zf.php or <Zend-Framework-home>/zf.php for Zend Framework 2.
    • <Symfony-home>/data/bin/symfony for Symfony 1.*.
    • <Symfony-home>/app/console for Symfony 2.
    • <Composer-home>/composer.phar for Composer
    • C:/ProgramData/Drush/drush.bat on Windows and /usr/bin/drush on Mac OS or Linux for Drush.
    • For Laravel, the path to the artisan bundled with the tool, for example, C:\MY_PROJECTS\PHP_PROJECTS\MyLaravelProject\artisan.
    • For Doctrine, the path to the tool home.
    IntelliJ IDEA searches the contents of the specified file for definitions of commands. When the analysis is completed, IntelliJ IDEA returns to the Command Line Tool Support page where the new tool is added to the list.
  5. In the Alias text box, specify the alias to use in calls of tool commands. Accept the default alias or edit it, if necessary.
  6. To activate the detected command set, select the Enabled check box.
  7. Customize the command set, if necessary.
  8. In the Show console in area, specify where you want to open the Input pane for typing commands:
    • To open the Input pane in a pop-up window, choose the Pop-up option.
    • To open the Input pane as a text box at the bottom of the Command Line Tools Console tool window, choose the Tool window option.

Defining your own PHP command line tool

  1. Open the Command Line Tool Support page (File | Settings | Tools | Command Line Tool Support for Windows and Linux or IntelliJ IDEA | Preferences | Tools | Command Line Tool Support for macOS) , and click ../../Shared/add.png on the toolbar.
  2. In the Command Line Tools dialog box that opens, select Custom tool from the Choose tool list, and specify the visibility level for it (Project or Global).
  3. In the Tool Settings dialog that opens, specify the path to the tool definition file, the tool alias, and provide a brief description of the tool.

    When you click OK, IntelliJ IDEA brings you to the Command Line Tool Support page, where the new tool is added to the list.

  4. Select the newly created tool and click ../../Shared/edit.png. In the tool definition .xml file that opens in the editor, define the tool commands.
  5. In the Show console in area, specify where you want to open the Input pane for typing commands:
    • To open the Input pane in a pop-up window, choose the Pop-up option.
    • To open the Input pane as a text box at the bottom of the Command Line Tools Console tool window, choose the Tool window option.