Installing PHP

When running a PHP project locally, it is required to have PHP installed. In addition in order to enable debugging features, there has to be Xdebug PHP extension properly enabled.

Automatic PHP installation

In case user does not have PHP with Xdebug installed or configured properly, PHP Tools offer quick installation from Microsoft Web Platform Installer.

Every time user starts their project (by default F5 or Ctrl+F5), PHP Tools automatically check the configuration. In case of an issue, quick configuration dialog will appear (see below).

Install PHP from Web Platform installer

The first option lets user to install latest PHP from Web Platform Installer with Xdebug support automatically configured. User may be asked for elevated rights. The process may require to install or update Web Platform Installer first.

During the installation process, command line may appear. Note the process may take several minutes, depending on user's network connection.

Install PHP from Web Platform installer

Remarks: Automatic PHP installation is not available on Windows XP platform. User may be asked for elevated rights. In case of insufficient permissions, the process may fail. The process requires an access to C:\Program Files\IIS Express\PHP\ folder and its content.

Manual PHP Configuration

In case user has configured PHP already, open Tools | Options | PHP Tools | Interpreter to review and access its settings and issues.

PHP Interpreter option

User should check whether correct PHP installation is used, and whether corresponding configuration file (php.ini) is correct. PHP path option tells Visual Studio what PHP will be used as a default interpreter & runtime. Dialog allows user to quickly access php.ini file and check & fix possible issues.

In case of configuration issue, user is notified with yellow bar and View recommendations button.

Not optional configuration detected

In case of configuration issue, user is notified with yellow bar and View recommendations button.

Issues dialog

Note: location of php.ini is determined in several steps, according to PHP behaviour. If the location is not correct, please check following:

  • System environment variable PHPRC forces PHP to use php.ini in specified location. Removing this environment variable is recommended.
  • PHP looks for php.ini in its directory, ensure php.ini file exists.
  • PHP specifies several other locations, such as system registry, for php.ini, follow wwww.php.net/manual/configuration.file.php for more information.