-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPStan process exited with error in WSL 2 #16
Comments
Hmm are you using the WSL extension in VSCode or are you using another way of opening the WSL folder? As far as I know, when using WSL in VSCode the file paths are all relative to the WSL root and don't use windows-style paths (such as |
You were right I wasn't running VSCode in the "correct way"; I had to navigate to the path inside WSL and there I had to But still it errors out with this [check:1] PHPStan process exited with error err= Xdebug: [Step Debug] Could not connect to debugging client. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port) :-( and I need to check PHPStan Language Server to know the errors diagnosed by PHPStan. Is this the way it is supposed to work or it should integrate with VSCode's diagnostics? |
It should work if you get rid of that error. I'm pretty sure it's caused by XDebug starting when it shouldn't (more info about how to fix it here). To debug it you can just try running PHPStan outside of the extension and you should run into the same error (the error isn't related to the PHPStan VSCode extension). After this it should no longer exit with an error and exit successfully and the errors diagnosed should be integrated into VSCode's diagnostics. |
Great to hear that it's working! It's surprisingly hard to ignore PHPStan errors. Since you can't rely on the exit code to find out whether it exited with an error, you have to look at whether stderr was set. I could then filter out any error that contains this xdebug string but I'm sure that won't work on systems with different languages or different xdebug settings (for example in this case it's using "Step Debug", another config might not). I'll definitely keep this in mind though, and if it happens more often I'll consider adding such a feature. For now I'll hold off on adding it. (I'll close the issue since I think your problem has been resolved) |
FYI I've implemented something close to what you suggested in the latest release. Instead of ignoring xdebug stuff, there's a new setting ( |
Hello,
when trying to run this extension inside a WSL container it gives me this error:
Settings are the default ones.
Any tips to make this work inside WSL?
The text was updated successfully, but these errors were encountered: