Php interpreter phpstorm linux

Configure PHP Remote Interpreter Dialog

The dialog is available only when the PHP Remote Interpreter plugin is enabled. The PHP Remote Interpreter plugin is bundled with PhpStorm and activated by default. If the plugin is disabled, enable it on the Installed tab of the Settings | Plugins page, as described in Managing plugins.

The dialog opens when you click Add in the left-hand pane of the CLI Interpreters dialog and choose From Docker, Vagrant, VM, WSL, Remote from the popup menu.

Use this dialog to configure access to PHP engines installed on remote hosts or in development environments set up in Vagrant or Docker instances.

Choose this option to configure access to a PHP interpreter on a remote host through SSH credentials. From the SSH configuration list, choose one of the created SSH configurations, or click and create a new configuration as described in Create SSH configurations.

To use an interpreter configuration, you need path mappings that set correspondence between the project folders, the folders on the server to copy project files to, and the URL addresses to access the copied data on the server. PhpStorm first attempts to retrieve path mappings itself by processing all the available application-level configurations. If PhpStorm finds the configurations with the same host as the one specified in the selected SSH configuration, the mappings from these configurations are merged automatically. If no configurations with this host are found, PhpStorm displays an error message informing you that path mappings are not configured.

To fix the problem, open the Deployment page under the Build, Execution, Deployment node, select the server access configuration, switch to the Mappings tab, and map local folders to folders on the server as described in Create a remote server configuration, section Mapping Local Folders to Folders on the Server and the URL Addresses to Access Them .

This option is available only when the PHP Docker and Docker plugins are enabled. The plugins are activated by default. If the plugins are disabled, enable them on the Installed tab of the Plugins page as described in Install plugins.

Choose this option to configure access to a PHP interpreter running in a Docker container. In the fields of the dialog, specify the following:

  • In the Server field, specify the Docker configuration to use, see Configure the Docker daemon connection settings for details. Select a configuration from the list or click New. and create a new configuration on the Docker page that opens.
  • In the Image name field, specify the base Docker image to use. Choose one of the previously downloaded or your custom images from the list or type the image name manually, for example, php:latest or php:7.0-cli . When you later launch the run configuration, Docker will search for the specified image on your machine. If the search fails, the image will be downloaded from the Docker Official Images repository on the Docker Registry page.
Читайте также:  Linux find file and tar

This option is available only when the PHP Docker and Docker plugins are enabled. The plugins are activated by default. If the plugins are disabled, enable them on the Installed tab of the Plugins page as described in Install plugins.

This functionality requires docker-compose version 1.18.0 or later.

Choose this option to configure access to a PHP interpreter running in a Docker container in a multi-container application. In the fields of the dialog, specify the following:

  • In the Server field, specify the Docker configuration to use, see Configure the Docker daemon connection settings for details. Select a configuration from the list or click New. and create a new configuration on the Docker page that opens.
  • In the Configuration file(s) field, specify the docker-compose.yml file defining the application’s services.
  • In the Service field, choose the desired application’s service.
  • Optionally, in the Environment variables field, define the environment variables. See Docker Compose run configuration settings for details.
  • For remote hosts, PhpStorm by default suggests the /usr/bin/php location.
  • For Vagrant instances, PhpStorm by default suggests the /usr/bin/php location.
  • For Docker containers, PhpStorm by default suggests the php location.

To specify a different folder, click and choose the relevant folder in the dialog that opens. Note that the PHP home directory must be open for editing.

When you click OK , PhpStorm checks whether the PHP executable is actually stored in the specified folder.

  • If no PHP executable is found, PhpStorm displays an error message asking you whether to continue searching or save the interpreter configuration anyway.
  • If the PHP executable is found, you return to the Interpreters dialog where the installation folder and the detected version of the PHP interpreter are displayed.

This option is available only when the Vagrant repository plugin is installed and enabled. The Vagrant plugin is not bundled with PhpStorm, but it can be installed on the Settings | Plugins page, tab Marketplace , as described in Installing plugins from JetBrains repository.

Choose this option to configure access to a PHP interpreter installed in a Vagrant instance using your Vagrant credentials. Technically, it is the folder where the VagrantFile configuration file for the desired environment is located. Based on this setting, PhpStorm detects the Vagrant host and shows it as a link in the Vagrant Host URL read-only field.

To use an interpreter configuration, you need path mappings that set correspondence between the project folders, the folders on the server to copy project files to, and the URL addresses to access the copied data on the server. PhpStorm evaluates path mappings from the VagrantFile configuration file.

Источник

CLI Interpreters

The dialog opens when you click next to the CLI Interpreter list in the Development environment section of the PHP page.

Use this dialog to configure PHP engines as interpreters , see Configure local PHP interpreters and Configure remote PHP interpreters. In this dialog, you can add new interpreters and edit or remove the existing ones.

The dialog consists of two panes. The left-hand pane lists all the configured PHP interpreters, both local and remote ones, and contains a toolbar for adding, removing, and copying PHP interpreter configurations. The contents of the right-hand pane depend on the type of the interpreter currently selected in the left-hand pane. Use the controls in this pane to edit the settings of the selected interpreter and even choose its type, if necessary.

Читайте также:  Linux запустить скрипт от имени другого пользователя

Left-hand pane

The left-hand pane lists all the configured PHP interpreters, both local and remote ones, and contains a toolbar for adding, removing, and copying PHP interpreter configurations.

Click this button to add a new PHP interpreter to the list. From the popup list, choose the interpreter type ( Local or Remote ), and configure a local interpreter in the right-hand pane or a remote interpreter in the Configure PHP Remote Interpreter Dialog dialog that opens.

Click this button to remove the selected interpreter from the list.

Click this button to create a new interpreter with the settings copied from the selected one.

Right-hand pane

The contents of the right-hand pane depend on the type of the interpreter currently selected in the left-hand pane. Use the controls in this pane to edit the settings of the selected interpreter and even choose its type, if necessary.

Remote interpreter accessible through SSH

From this list, choose one of the created SSH configurations, or click and create a new configuration as described in Create SSH configurations.

Remote interpreter on a Vagrant instance

In this field, choose the folder that points at the environment you are going to use. Technically, it is the folder where the VagrantFile configuration file for the desired environment is located. Based on this setting, PhpStorm detects the Vagrant host and shows it as a link in the Vagrant Host URL read-only field.

Remote interpreter in a Docker container

In this field, specify the Docker configuration to use, see Configure the Docker daemon connection settings for details. Select a configuration from the list or click New. and create a new configuration on the Docker page that opens.

In this field, specify the base Docker image to use. Choose one of the previously downloaded or your custom images from the list or type the image name manually, for example, php:latest or php:7.0-cli . When you later launch the run configuration, Docker will search for the specified image on your machine. If the search fails, the image will be downloaded from the Docker Official Images repository on the Docker Registry page.

Remote interpreter running in a multi-container Docker Compose application

in this field, specify the Docker configuration to use, see Configure the Docker daemon connection settings for details. Select a configuration from the list or click New. and create a new configuration on the Docker page that opens.

In this field, specify the docker-compose.yml file defining the application’s services.

In this field, choose the desired application’s service.

In this field, define the environment variables. See Docker Compose run configuration settings for details.

In this area, choose how the Docker container for the selected service should be managed by PhpStorm.

  • Always start a new container (‘docker-compose run’) : choose this option to have the container started via the run command. The container will be restarted upon each run.
  • Connect to existing container (‘docker-compose exec’) : choose this option to have the container started once, and then connect to it via the exec command.
Читайте также:  Astra linux док панель

Remote interpreter running through Windows Subsystem for Linux (WSL)

From this list, choose one of the installed Linux distributions to use.

General area

In this field, type the identifier to distinguish the interpreter from others, for example, php_installation_ .

In this field, specify the path to the PHP engine. Type the path manually or click and choose the executable file in the dialog that opens. PhpStorm detects the version of PHP and displays it in the PHP version read-only field.

PhpStorm also detects the debugging engine and the php.ini configuration file. The type of the debugging engine associated with the PHP interpreter and its version are displayed in the Debugger read-only field. If no debugger is detected or you have disabled it in php.ini file (see Configuring Xdebug for Using in the On-Demand Mode), the field shows Debugger: Not installed .

The location of php.ini is displayed in the Configuration file read-only field. To edit the php.ini in PhpStorm, click Open in Editor .

Click this button to check that the specified PHP home directory actually contains a PHP executable file. If no PHP executable is detected at the specified location, PhpStorm displays the corresponding error message.

Click this button 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 PHP Interpreters dialog are not listed.

Advanced area

In this field, specify the location of the Xdebug extension to enable PhpStorm to activate it when necessary.

PhpStorm supports the On-Demand mode, where you can disable debugger for your global PHP installation and have it enabled automatically on demand only when you are debugging your command-line scripts or when you need code coverage reports. This lets your command line scripts (including Composer and unit tests) run much faster.

Use this field to customize the configuration settings of the installation by composing a string of configuration directives to be passed through the -d command line option and thus add new entries to the php.ini file. Click to open the Configuration Options dialog and create a list of new php.ini entries there.

Configuration options dialog

In this field, type the name of the new entry.

In this field, type the value of the new entry.

Click this button to have a new line added to the list and specify the name and value of a new entry there.

Click this button to remove the selected entry from the list.

Use these buttons to move the selected entry up or down in the list. The order of entries in the list determine the order in which they are passed through the -d command line option.

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.

Источник

Оцените статью
Adblock
detector