Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PHP

Install

Intelephense is the most popular PHP language server.

macOS

npm install -g intelephense

Linux

npm install -g intelephense

Windows

npm install -g intelephense

Config

Add to ~/.config/catenary/config.toml:

[server.intelephense]
command = "intelephense"
args = ["--stdio"]

[language.php]
servers = ["intelephense"]

Notes

  • Intelephense has a free tier and a premium tier with additional features
  • The free tier includes: completions, hover, definitions, references, diagnostics, formatting
  • Premium adds: rename, code actions, go to implementation
  • Works great with Laravel, Symfony, WordPress, and vanilla PHP

Alternatives

phpactor

A free, open-source alternative:

# Install via composer
composer global require phpactor/phpactor
[server.phpactor]
command = "phpactor"
args = ["language-server"]

[language.php]
servers = ["phpactor"]