Configuring Local PHP Interpreters
A local PHP interpreter is a PHP engine installed on your computer opposite to a remote PHP interpreters that can be installed on a remote host or in a virtual environment set up in a Vagrant instance, see Configuring Remote PHP Interpreters.
On the PHP page that opens, click next to the CLI Interpreter list.
-
In the CLI Interpreters dialog that opens, click in the left-hand pane, then choose Local from the popup menu.
If you already have a local interpreter configured in PhpStorm, it is also shown from the menu and the menu item changes to Other Local.
-
In the right-hand pane of the dialog, specify the PHP interpreter's settings.
In the Name field, type the identifier to distinguish the interpreter from others, for example,
php_installation_<version>
.-
Specify the PHP engine installation directory in the PHP Executable field. Type the path manually or click and select the relevant folder in the dialog that opens.
PhpStorm displays the version of the PHP engine detected in the specified folder and the debugger associated with this PHP engine in the php.ini file.
-
Optionally, you can customize the configuration settings of the PHP installation in the Additional area of the CLI Interpreters dialog.
In the Debugger extension field, specify the path to Xdebug. This enables PhpStorm to activate Xdebug when it is necessary if you have disabled it in the php.ini file, see Configuring Xdebug for Using in the On-Demand Mode.
-
In the Configuration options field, compose a string of configuration directives to be passed through the -d command line option and thus add new entries to the php.ini file. The directives specified in this field override the default directives generated by PhpStorm, such as
-dxdebug.remote_enable=1
,-dxdebug.remote_host=127.0.0.1
,-dxdebug.remote_port=9001
,-dxdebug.remote_mode=req
.For example, if you specify the
-dxdebug.remote_mode=jit
directive it will override the default-dxdebug.remote_mode=req
directive and thus switch Xdebug to the Just-In-Time (JIT) mode, see Debugging in the Just-In-Time Mode for details.To do that, click next to the Configuration options field, and then create a list of entries in the Configuration Options dialog that opens.
- To add a new entry, click . In the new line, that is added to the list, specify the name of the new entry and its value in the Name and Value fields respectively.
You can add as many entries as you need, just keep in mind that they will be transformed into a command line with its length limited to 256 characters.
To delete an entry, select it in the list and click .
To change the order of entries, click or .
Upon clicking OK, you return to the CLI Interpreters dialog, where the entries are transformed into a command line.
- To add a new entry, click . In the new line, that is added to the list, specify the name of the new entry and its value in the Name and Value fields respectively.
-
Click to have PhpStorm display a separate information window with the installation details and the list of loaded extensions and configured options. Note that the additional options specified in the Configuration Options field of the CLI Interpreters dialog are not listed.