Can't Get XDebug to Debug

I just switched from a Windows machine to a Mac, and I’m having trouble getting Xdebug to work properly on the Mac.

On both machines I’m using XDebug, php 5.6, and PHPStorm. Historically, I have set up the path mappings to go to /app/public, fired up Xdebug, and it worked without a hitch.

That’s not working on the new machine. I’ve been crawling the forums for hours trying to come up with a solution, and everything I’ve tried hasn’t worked.

I’ve tried using the “one click IntelliJ support” setting. I’ve even got the Local By Flywheel option in PHPStorm, but it behaves exactly the same now matter what I do. It just…doesn’t do anything. The site loads as-if I’m not trying to run the debugger.

I connected to the terminal via SSH on both my Windows Machine, and my Mac. I ran php -v, and noticed that the Windows machine has XDebug installed remotely, but the Mac does not. I suspect this is the source of my problem, but I have no idea how to resolve it.

Help!

Hi Alex,

Sorry for the late reply!

Are you using the “Preferred” environment? If so, it doesn’t have Xdebug. It needs communicated more clearly.

1 Like

Yep - that resolved it. Sorry, I should have updated you.

It definitely needs communicated more clearly! I spent a lot of time last week trying to figure this out.

Thanks for everything you guys do. I love this program.

1 Like

@alexstandiford how’d you get it to work? I created another site (Custom) and then imported the site into it and click the Configure PHPStorm IDE and still do not see it in the Configurations.

Did you import something?

Hey Rez, sorry I just realized that you sent me this question.

I’ve never had much luck with the configure phpstorm and intellij ides button. Instead I just do this in PHPStorm for each install manually:

Basically, you go to settings>>>Languages & Frameworks>>>PHP and add these directories to your include path:

  • /app/public/wp-content
  • /app/public/wp-includes
  • /app/public/wp-admin
  • /app/public

Once you do that, click Okay, and re-open settings (there’s a weird behavior in PHPStorm that prevents the servers list form updating when you add include paths).

Then go to settings>>>Languages & Frameworks>>>PHP again

Expand your include path and change it so that the absolute path on the server matches the image above, as /app/public.

Click OK, and you’re good to go.

Also, if you DID already set up the site as a preferred environment, I’m sorry but your only option is to export your current site, and re-import the same site using a custom environment. Hopefully in the future Flywheel will set it up so that “Dev Mode” enables and disables XDebug or something. It’s a real drag that i can’t use their preferred environment simply because I want to use XDebug on my local environment.

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.

Update - You can now simply change from a preferred environment to a custom environment WITHOUT exporting/importing (Thanks Flywheel! <3)

Simply click on “change” by the “local environment” item in your overview tab.
image