Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

PHP language server stopping unexpectedly #34

Closed
buleedan opened this issue Sep 17, 2017 · 14 comments
Closed

PHP language server stopping unexpectedly #34

buleedan opened this issue Sep 17, 2017 · 14 comments

Comments

@buleedan
Copy link

buleedan commented Sep 17, 2017

I've recently installed the new version of atom (1.21) where I've been installing the atom-ide-ui and ide-php packages (and some others too).
I don't know why, when I develop on JS, the diagnostic and outline view are working properly, but as soon as I open a php file, I have an error popup showing telling me that "PHP language server stopped unexpectedly." (as on the screenshot).

php_server_error

This error happen anytime I open a php file for the first time after launching Atom (whether or not a php page is already opened when i launch atom).

Thanks,

Robin

@3Descape
Copy link

please try Ctrl+Shit+i to open the console and see if there are errors that give us some more information

@damieng
Copy link
Contributor

damieng commented Sep 17, 2017

Also can you confirm you have ide-php 0.6.6 (latest) - 0.6.5 would incorrectly display this error when the language server shut down correctly.

@buleedan
Copy link
Author

I confirm i've updated today the ide-php 0.6.6 and still had that issue.

Concerning the console, I have no error showing up after opening a php page.

screen shot 2017-09-18 at 02 16 47

Is there any package I should have (or not have) to make it work?

Here is the listing of my installed packages:
atom-beautify@0.30.5
atom-ide-ui@0.3.3
atom-minify@0.8.0
autoclose-html@0.23.0
autocomplete-modules@1.7.0
autocomplete-php@0.3.7
busy-signal@1.4.3
code-peek@1.4.21
color-picker@2.2.5
docblockr@0.11.0
file-icons@2.1.11
git-plus@7.9.3
highlight-selected@0.13.1
ide-json@0.1.0
ide-php@0.6.6
ide-typescript@0.6.1
intentions@1.1.5
jscrambler@0.2.7
laravel@0.7.1
lines@0.13.1
linter@2.2.0 (disabled)
linter-ui-default@1.6.9 (disabled)
minimap@4.29.6
minimap-pigments@0.2.2
pigments@0.40.2
remote-edit@1.9.0 (disabled)
sort-lines@0.15.0
todo-show@2.0.0

@damieng
Copy link
Contributor

damieng commented Sep 17, 2017 via email

@buleedan
Copy link
Author

Actually previously I already had a similar problem with my linter, which didn't work either.
The weird thing is that it works totally fine with JS, but not with PHP.

@damieng
Copy link
Contributor

damieng commented Sep 17, 2017

Behind the scenes the packages use very different technologies from different vendors so it wouldn't surprise me that one works when one does not. The JS/TS one is written in JavaScript and runs using the node runtime. The PHP one is written in PHP and uses PHP 7 runtime.

@buleedan
Copy link
Author

actually today i've just installed the PHP 7 runtime and also run it with my MAMP. But in vain...

@rkhitin
Copy link

rkhitin commented Sep 18, 2017

I had this problem on osx related to installing PHP7 via homebrew. Decided with the command sudo launchctl config user path "/usr/local/bin:$PATH" from https://docs.brew.sh/FAQ.html

@buleedan
Copy link
Author

By doing a php -v , I saw that it was running a php 5.5.36.
I've tried your command line to change the path, but after rebooting my computer, always going back from php 7 to php 5.5.36.
Finally been able to change manually to php 7.0 and 5.6.10, but still having same issue after rebooting, even if the php version has been well changed.

@mikebronner
Copy link

I recommend installing PHP using https://php-osx.liip.ch instead of homebrew, you might want to give that a try?

@buleedan
Copy link
Author

buleedan commented Sep 18, 2017

Thanks, seems like we are going on the right way. I now have a different error issue. It used to be undefined as we can see on the previous screenshot.

Now I have:

PHP language server stopped unexpectedly.
PHP Parse error: syntax error, unexpected '{', expecting identifier (T_STRING) in /Users/Rabou/.atom/packages/ide-php/vendor/felixfbecker/language-server/bin/php-language-server.php on line 3

@damieng
Copy link
Contributor

damieng commented Sep 18, 2017

That indicates to me your system is not using PHP 7 but an older version. The syntax on that line is trying to use the {} syntax for use statements which was not supported in older versions.

I'm going to put a explicit version check into the next update of ide-php so it checks and then stops if PHP 7 is not the one specified in the path or ide-php config.

@buleedan
Copy link
Author

Thanks a lot mate!
Yes i'm sorry I've been installing the php 5.6 (since i've been mostly developing using it recently).
Just installed the php 7.1.9 and now everything run smoothly.

Thanks a lot for the help!

@damieng
Copy link
Contributor

damieng commented Sep 18, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants