Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ian_h's avatar
Level 20

PhpStorm, Xdebug, Homestead (again!?)

Hi all..

This is extremely frustrating, but I have no idea why.. but I just can't seem to get this setup working on my homestead server, either as a "direct" xdebug connection, or through dbgp proxy.

I use dbgp proxy for my local network dev server (running Debian) and it all works fine, I set up the dbgp config, create a remote debugging setup, set the remote mappings up, job done... but alas, with homestead, it's just not having it.

dbgp reports everything working and a connection established:

vagrant@homestead:~/dbgp$ ./startdbg.sh
INFO: dbgp.proxy: starting proxy listeners.  appid: 4712
INFO: dbgp.proxy:     dbgp listener on 127.0.0.1:9000
INFO: dbgp.proxy:     IDE listener on  192.168.10.10:9001

INFO: dbgp.proxy: Server:onConnect ('192.168.10.1', 28793) [proxyinit -p 9003 -k bubbleboy -m 1]

In my PhpStorm servers, I have this configured:

Name: homestead
Host: localsite.dev (same as the "domain" for the dev site as per my hosts file)
Port: 80
Debuger: Xdebug

Path mappings are in the format of:

File/Directory:
C:\local\src\dir\app        /home/vagrant/Code/local/src/dir/app

etc etc. This is how I have it all set up working on my local network remote dev server.

PHPInfo shows that Homestead is running Xdebug so all should be well.

So then I have something simple in routes.php:

Route::get('/', 'PagesController@home');

and within that controller action:

class PagesController extends Controller
{
    public function home()
    {
        $foo = 'bar';

[*]        return view('pages.home', [
            'title'     => 'Welcome to website',
        ]);
    }
}

[*] represents a breakpoint here.

I enable the 'listen for debug connections' in PhpStorm, select my 'homestead' config from the debug selector, hit the 'debug' button and it starts...

(!) Waiting for incoming connection with ide key 'bubbleboy'

which is great and what I have set up in 20-xdebug.ini. I then click on my Firefox 'The easiest debug' debug button and refresh the page but it fails to stop at the breakpoint.

If anyone has any suggestions on getting this working with Homestead, I'd love to hear them, as whilst var_dump() works, having a step-by-step debugger available is far more handy for complex applications =)

Cheers..

Ian

PS: I did do a search here (and the intertubes in general) and nothing has yet got me to the point I can use debugging =(

0 likes
1 reply
ian_h's avatar
Level 20

Argh! Now I feel like a muppet!

Would help if I mapped the mappings to the correct remote path!! That'll teach me to have multiple versions of code within similar subdirs =(

I had for example:

File/Directory:
C:\local\src\dir\app        /home/vagrant/Code/local/src/dir/app

and

C:\local\src\dir\app\subdir\src        /home/vagrant/Code/local/src/dir/app/subdir/src

I'm now using the latter, but had things mapped to the former.. doh!

Issue averted... debugging session underway =D

Cheers..

Ian

Please or to participate in this conversation.