Files
zed/docs/src/languages/php.md
T
Marshall Bowers a9f7c0549c docs: Use correct name for Intelephense license file (#26986)
This PR updates the Intelephense section of the PHP docs to use the
correct name for the license file.

Intelephense uses British English:

<img width="1185" alt="Screenshot 2025-03-18 at 8 30 20 AM"
src="https://github.com/user-attachments/assets/a675e854-bedf-4f70-bf8f-90488d196242"
/>

Release Notes:

- N/A
2025-03-18 12:31:57 +00:00

49 lines
1.6 KiB
Markdown

# PHP
PHP support is available through the [PHP extension](https://github.com/zed-extensions/php).
- Tree-sitter: https://github.com/tree-sitter/tree-sitter-php
- Language Servers:
- [phpactor](https://github.com/phpactor/phpactor)
- [intelephense](https://github.com/bmewburn/vscode-intelephense/)
## 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:
```sh
# 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](https://intelephense.com/) is a [proprietary](https://github.com/bmewburn/vscode-intelephense/blob/master/LICENSE.txt#L29) language server for PHP operating under a freemium model. Certain features require purchase of a [premium license](https://intelephense.com/). To use these features you must place your [licence.txt file](https://intelephense.com/faq.html) at `~/intelephense/licence.txt` inside your home directory.
To switch to `intelephense`, add the following to your `settings.json`:
```json
{
"languages": {
"PHP": {
"language_servers": ["intelephense", "!phpactor", "..."]
}
}
}
```
## PHPDoc
Zed supports syntax highlighting for PHPDoc comments.
- Tree-sitter: [claytonrcarter/tree-sitter-phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc)