ZIm/docs/src/languages/php.md
Stephen Samra 42b2b65241
Document alternative method to providing intelephense license key (#34502)
This PR updates the [Intelephense section in the
docs](https://zed.dev/docs/languages/php#intelephense) to include an
alternative way to provide the premium license key.

Release Notes:

- N/A
2025-07-16 06:14:18 +00:00

1.9 KiB

PHP

PHP support is available through the PHP extension.

Choosing a language server

The PHP extension offers both phpactor and intelephense language server support.

phpactor is enabled by default.

Phpactor

The Zed PHP Extension can install phpactor automatically but requires php to installed and available in your path:

# brew install php            # macOS
# sudo apt-get install php    # Debian/Ubuntu
# yum install php             # CentOS/RHEL
# pacman -S php               # Arch Linux
which php

Intelephense

Intelephense is a proprietary language server for PHP operating under a freemium model. Certain features require purchase of a premium license.

To switch to intelephense, add the following to your settings.json:

{
  "languages": {
    "PHP": {
      "language_servers": ["intelephense", "!phpactor", "..."]
    }
  }
}

To use the premium features, you can place your licence.txt file at ~/intelephense/licence.txt inside your home directory. Alternatively, you can pass the licence key or a path to a file containing the licence key as an initialization option for the intelephense language server. To do this, add the following to your settings.json:

{
  "lsp": {
    "intelephense": {
      "initialization_options": {
        "licenceKey": "/path/to/licence.txt"
      }
    }
  }
}

PHPDoc

Zed supports syntax highlighting for PHPDoc comments.