This guide covers integrating php-lsp with ALE in Vim/Neovim.
Add the following to your .vimrc or init.vim:
" Register php-lsp as a linter for PHP files
let g:ale_linters = {
\ 'php': ['php-lsp'],
\}
" Set the executable path
let g:ale_php_php_lsp_executable = '/path/to/vendor/bin/php-lsp'If ALE doesn't recognize php-lsp as a built-in linter, you may need to define it manually:
call ale#linter#Define('php', {
\ 'name': 'php-lsp',
\ 'lsp': 'stdio',
\ 'executable': '/path/to/vendor/bin/php-lsp',
\ 'project_root': function('ale_linters#php#langserver#GetProjectRoot'),
\})- Open a PHP file
- Run
:ALEInfoto see the active linters and any error messages - Check
:messagesfor LSP communication logs