Xdebug on WSL
6 posts
• Page 1 of 1
Xdebug on WSL
I have been trying to use nginx and php-fpm on a local windows machine in a linux subsystem, which seems to work well enough after some tweaking, however xdebug did not seem to work off the bat, although the settings appear to be correct, I adjusted the directory mapping and all that.
No joy, however.
Did anyone manage to get it working on WSL?
No joy, however.
Did anyone manage to get it working on WSL?
- Disclosure
- Posts: 29
- Joined: September 21st, 2015, 6:37 pm
Re: Xdebug on WSL
Both VS PHP debugger and both appear to be listening on port 9000:
However they are not making a connection.
Edit: actually a correction, that is php-fpm listening on 9000 for connections from nginx. I changed the xdebug port to 8000 but it did not appear in the list.
However they are not making a connection.
Edit: actually a correction, that is php-fpm listening on 9000 for connections from nginx. I changed the xdebug port to 8000 but it did not appear in the list.
You do not have the required permissions to view the files attached to this post.
- Disclosure
- Posts: 29
- Joined: September 21st, 2015, 6:37 pm
Re: Xdebug on WSL
Hello,
Thanks for the post.
xdebug.remote_port setting has to be the same as in PHP Tools options (in Visual Studio, Tools | Options | PHP Tools | Advanced). The default value is 9000 and it is usually enough just to leave it as it is.
This other process php-fpm blocks port 9000. Change Xdebug port to 9001 both in php.ini and in Visual Studio settings. Note that restarting nginx will not reload php.ini! You will need to restart the server.
Please let me know if that helped.
Cheers!
Thanks for the post.
xdebug.remote_port setting has to be the same as in PHP Tools options (in Visual Studio, Tools | Options | PHP Tools | Advanced). The default value is 9000 and it is usually enough just to leave it as it is.
This other process php-fpm blocks port 9000. Change Xdebug port to 9001 both in php.ini and in Visual Studio settings. Note that restarting nginx will not reload php.ini! You will need to restart the server.
Please let me know if that helped.
Cheers!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Xdebug on WSL
Hi Miroslav,
I have tried that, and a number of other things, unfortunately, that did not help. I think there is something up with WSL environment as it seems like when a connection to nginx is made, xdebug is not making a connection back, TCPView does not register it spawning at the port specified. There is also a bunch of not very descriptive errors in php-fpm's log, although that may be not related.
I fell back to using a VM for now, hopefully they will be able to put WSL into a proper shape soon enough. It mostly works, except this strange issue with xdebug.
I have tried that, and a number of other things, unfortunately, that did not help. I think there is something up with WSL environment as it seems like when a connection to nginx is made, xdebug is not making a connection back, TCPView does not register it spawning at the port specified. There is also a bunch of not very descriptive errors in php-fpm's log, although that may be not related.
I fell back to using a VM for now, hopefully they will be able to put WSL into a proper shape soon enough. It mostly works, except this strange issue with xdebug.
- Disclosure
- Posts: 29
- Joined: September 21st, 2015, 6:37 pm
Re: Xdebug on WSL
Hi,
Thank you for trying this and providing us with your findings. Let us also try WSL, it's interesting use case! We will get back with whatever we find.
Have a good one,
Thank you for trying this and providing us with your findings. Let us also try WSL, it's interesting use case! We will get back with whatever we find.
Have a good one,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
Re: Xdebug on WSL
Hi guys,
I've written tutorial on how to setup Windows Linux Subsystem for Linux for PHP projects on Visual Studio. I hope it will be useful for somebody.
https://blog.devsense.com/2018/04/wsl
Cheers!
I've written tutorial on how to setup Windows Linux Subsystem for Linux for PHP projects on Visual Studio. I hope it will be useful for somebody.
https://blog.devsense.com/2018/04/wsl
Cheers!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 62 guests