Xdebug - Windows on LAN w/ Debian based LAMP at 10.0.0.xxx

Discuss server installationa nd configuration issues here

Moderators: gesf, Michalio

Post Reply
User avatar
ajaxStardust
New php-forum User
New php-forum User
Posts: 12
Joined: Fri Jul 08, 2022 3:10 am

[ Xdebug ]

I find it difficult to get any of the IDE's to cooperate with a step-debugging setup in my LAN LAMP dev environment. I've never tried debugging "remotely" like this before, and I'm afraid I've hit a roadblock.

What do you recommend?

I am doing LAMP dev work on my private LAN with LAMP running on MX-Linux 21 (debian-based). I prefer working in the Windows desktop (same LAN), but the server response time / db performance, etc., is remarkably better w/ LAMP on the separate machine, so LAMP is a remote machine.

(note: apparently this question was not fit for StackOverflow. I don't know how else to ask it. https://stackoverflow.com/questions/73643022/xdebug-windows-on-lan-w-debian-based-lamp-at-10-0-0-xxx )
User avatar
Michalio
Moderator
Moderator
Posts: 315
Joined: Sun Jul 18, 2021 1:33 pm
Location: Poland

the best way for debbuging is to have dev environment on the same machine, you can use docker or similar solution if you need to have different configuration.

do you have xdebug v2 or v3?
check this thread about configuring the xdebug: https://www.php-forum.com/phpforum/viewtopic.php?t=30021
try to change IP from loopback (127.0.0.1) to yours IPs of you device with IDE and device with php
Free coding lessons: https://php-forum.com/phpforum/viewtopic.php?t=29852
User avatar
ajaxStardust
New php-forum User
New php-forum User
Posts: 12
Joined: Fri Jul 08, 2022 3:10 am

i don't know how to make the screenshot link work. feel free to delete it.
Xdebug v3 - Image
https://imgur.com/asJ6ZTE

I figured as much about the debugging. I use VS Code, and tried various permutations of configurations. (there's a lot of settings i'm sure you're aware, options of course, but basically \\10.0.0.x\htdocs\ | ssh://10.0.0.x | canonical \\linux-mx\htdocs (where htdocs is a shared folder via samba from the Linux box, and I CHMOD 777 for the win desktop. i can write to that dir from Win. Not sure how secure that is, but it's only accessible on my LAN [afaik])

I thought maybe someone might know of the "magic IDE" that seems to work on such a setup [he speaks of legends!]. I know i've had situations where Netbeans would connect on 9003, while no others would. VS Code tends to be pretty magic, in just about every environment.

Performance for a Development server is so much better setup like that-- **so that's why i'm strugging with this**. I never realized. I thought WSL was fast for a dev environment! (vs Apache as a service on Win; WAMP or whatever)

(Thank you. You're cool. I get so sick of attitude in forums anymore. After 20 years, it's like: why make it so hard on yourself, dude? Really? There's a manual somewhere. I wouldn't be asking questions if i knew where to find the answer. i dunno... lol. sorry. i've been holding that in for a few years! haha)
Last edited by ajaxStardust on Fri Sep 09, 2022 4:40 am, edited 1 time in total.
User avatar
ajaxStardust
New php-forum User
New php-forum User
Posts: 12
Joined: Fri Jul 08, 2022 3:10 am

I just thought of something!
I'm was able to do step-debugging from an IDE on Win w/ folders on local drive

Code: Select all

H:\Apache2\htdocs
, "LAMP" on -> WSL -> Apache2

Code: Select all

DOCUMENT_ROOT /mnt/h/Apache2/htdocs
, and pointed the Windows -> some IDE location executable to E.g.

Code: Select all

H:\PHP\php.exe 
...and it worked. i wouldn't have expected it to. i'm going to try that here.
sorry, I know I write a lot. It's always been a genuine struggle for me.

EDIT:
I totally forgot you recommended Docker. I'll try that as well. I don't have Docker setup here yet. Just migrated to a "mini-pc" w/ Windows 11.
Post Reply