Skip to main content

emacs29 intelephense

Emacs 29 and PHP Intelephense

I use to use Emacs and PHP Intelephense for PHP development. I recently upgraded to Emacs 29 and PHP Intelephense stopped working. I found a solution on Reddit Based on that, I rewrote my .emacs file to use eglot instead of lsp-mode, and this is the result.
(use-package eglot
  :ensure t)
(add-hook 'php-mode-hook 'eglot-ensure)
(use-package php-mode
  :ensure t
  :mode
  ("\\.php\\'" . php-mode))

(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
(provide 'lang-php)

(use-package company
  :ensure t
  :config
  (setq company-idle-delay 0.3)
  (global-company-mode 1)
  (global-set-key (kbd "M-") 'company-complete))
  (require 'eglot)
  (add-to-list 'eglot-server-programs
        '((php-mode :language-id "php") . ("intelephense" "--stdio" :initializationOptions
				(:licenseKey "98989898989898989898"))))