Installation

The extension is installed through the VSCode's main window. Please refer to managing extensions in VS Code for detailed information.

After the successful installation, you should be prompted to activate your copy of PHP Tools.

Offline installation

You can download the .vsix installation file from our download section. The installation file has to be installed using the VSCode's Command palette, command Extensions: Install from VSIX.

The program may perform an additional download of dependencies during the first start, after the installation. Please, be sure to have an Internet connection. In case your computer cannot go online, do one of the following:

  • Install Microsoft .NET Core 2.x Runtime for your platform (More information on https://www.microsoft.com/net/download), or
  • Download the dependency manually. See VSCode's Output, panel 'PHP', for the log and the URL of the dependency. Extract the zip file into /out/server of the extension's installation directory.

Configuration options

The following settings are introduced by the extension. Navigate to VSCode's Settings in order to see or modify them.

Setting Values Description
php.executablePath Full path to the php program, or not set. Specifies the full path to the php program that will be used within test explorer and debugging.
php.problems.exclude Associative map of paths and whether to exclude them from problems checking. Specifies what problems will be hidden in specified directories. It is possible to set true to ignore all problems, or an array of error codes. Sample: {'/vendor/**':true, '/tests/**':[6501,6555]}. See problems configuration.
phpTools.language "en", "de", "es", "fr", "ja", "pt", "ro", "ru", "tr", "zh", or not set. Specifies the language code of integrated documentation. If not set, the setting defaults to system's language.
files.exclude Associative map of paths to be excluded from the project. Specifies files that won't be processes by the code analysis engine (code completion, navigation, problems).

License activation

In case the extension is not activated, a pop-up window is shown during the extension startup. It gives the following options:

Activate PHP Tools

  • I have the license key lets you enter the license key section and activate the extension.
  • Get trial sends you an e-mail with 14-day license key.
  • More information opens this web page with purchase and license information.

Once you obtain the license key and you close the pop-up window above, you can activate your copy of the extension using the VSCode's Command palette, command PHP Tools: Activate extension. Enter your license key and confirm with Enter.

Enter License Key

The activation requires an Internet connection. The successful installation is confirmed with the following pop-up window:

Enter License Key

PHP requirements

Testing and debugging features require the PHP program to be installed and configured. It is recommended to use PHP 7.0 or newer; however, PHP 5.4 and newer are supported as well.

Running tests and built-in development server requires php with extensions dom, json, mbstring and xmlwriter. Either install php globally, so the command php will work across the system, or set php.executablePath setting within VSCode's Settings pointing to PHP executable.

Debugging locally requires the Xdebug extension installed and enabled. See Xdebug configuration for more information.

Recommended

  • PHP 7.0 or newer
  • PHP extensions dom, xsl, mbstring
  • PHP extension xdebug with the following options in your php.ini:
    • xdebug.remote_enable = 1
    • xdebug.remote_autostart = 1

Related links