系统:MacOs
通过 brew
安装 composer
,此时其默认安装php最新版。
使用 composer
安装php-language-server
,
命令 composer global require felixfbecker/language-server
发现错误,不支持当前php版本,故用brew安装[email protected]
再次运行安装php-language-server
的命令,
打开Emacs(purcell配置),打开test.php,尝试连接Eglot,报错[Eglot] -1:Server died
尝试运行php php-language-server.php,报错Could not open input file: php-language-server.php
在php文件所在目录运行 php ./php-language-server.php
则产生如下报错
PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /Users/yifeng/.composer/vendor/netresearch/jsonmapper/src/JsonMapper.php on line 280
Deprecated: Array and string offset access syntax with curly braces is deprecated in /Users/yifeng/.composer/vendor/netresearch/jsonmapper/src/JsonMapper.php on line 280 PHP Fatal error: Uncaught LogicException: “throwOnError” is no longer supported, use “errorHandler” instead in /Users/yifeng/.composer/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php:125 Stack trace: #0 /Users/yifeng/.composer/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php(27): PhpParser\ParserAbstract->__construct(Object(PhpParser\Lexer), Array) #1 /Users/yifeng/.composer/vendor/felixfbecker/language-server/src/Project.php(39): PhpParser\ParserFactory->create(1, Object(PhpParser\Lexer), Array) #2 /Users/yifeng/.composer/vendor/felixfbecker/language-server/src/LanguageServer.php(76): LanguageServer\Project->__construct(Object(LanguageServer\LanguageClient)) #3 /Users/yifeng/.composer/vendor/felixfbecker/language-server/bin/php-language-server.php(31): LanguageServer\LanguageServer->__construct(Object(LanguageServer\ProtocolStreamReader), Object(LanguageServer\ProtocolStreamWriter)) #4 /Users/yifeng/.composer/vendor/bin/php-language-server.php(18): include(‘/Users/yifeng/…’) #5 {ma Fatal error: Uncaught LogicException: “throwOnError” is no longer supported, use “errorHandler” instead in /Users/yifeng/.composer/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php:125 Stack trace: #0 /Users/yifeng/.composer/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php(27): PhpParser\ParserAbstract->__construct(Object(PhpParser\Lexer), Array) #1 /Users/yifeng/.composer/vendor/felixfbecker/language-server/src/Project.php(39): PhpParser\ParserFactory->create(1, Object(PhpParser\Lexer), Array) #2 /Users/yifeng/.composer/vendor/felixfbecker/language-server/src/LanguageServer.php(76): LanguageServer\Project->__construct(Object(LanguageServer\LanguageClient)) #3 /Users/yifeng/.composer/vendor/felixfbecker/language-server/bin/php-language-server.php(31): LanguageServer\LanguageServer->__construct(Object(LanguageServer\ProtocolStreamReader), Object(LanguageServer\ProtocolStreamWriter)) #4 /Users/yifeng/.composer/vendor/bin/php-language-server.php(18): include(‘/Users/yifeng/…’) #5 {main} thrown in /Users/yifeng/.composer/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php on line 125
大佬们帮帮忙,多谢了