StephenMiracle / frankenwp

MIT License
117 stars 11 forks source link

Support xdebug? #7

Closed ngdangtu-vn closed 3 months ago

ngdangtu-vn commented 4 months ago

I couldn't make xdebug work in official wordpress image. I wonder if it would be possible with frankenphp.

PascaleBeier commented 4 months ago

Hey, I'm curious, may I ask what your usecase is? Maybe a development image?

ngdangtu-vn commented 4 months ago

I just try debugging wp from local docker since I don't know better way to debug it when I need to work with API and redirect problem where I couldn't var_dump everything onto the page.

PascaleBeier commented 4 months ago

Super offtopic, but we usually use ddev.com for local development, maybe it helps you. The way wordpress is dockerized we get around doing that without having production parity in the dev environment and get a nice xdebug integration.

I wonder if people actually make the effort to build up to date development images, from my experience, they are rather cumbersome to maintain.

StephenMiracle commented 4 months ago

Ya. I like that . Adding xdebug since its supported in FrankenPHP.

You could reference this image as the start from on a new docker image.

There is a debug value in the environment variables which will turn on wp_debug as well as debug for Caddy.

I probably won't add xdebug to this image since that is a dev customization. Should be a pretty quick add if you want to extend.

--

I would be open to a dev image if there's enough request for it.

ngdangtu-vn commented 4 months ago

If it was easy, I would submit a PR instead of an issue -_-

StephenMiracle commented 4 months ago

hm. Maybe there is an opportunity for a dev image.

I created a poll to see how much traction we can get on it.

https://github.com/StephenMiracle/frankenwp/discussions/16

I might be able to create some documentation on how to setup xdebug without having an officially supported image.

Please feel free to vote @ngdangtu-vn and whomever else.

StephenMiracle commented 4 months ago

Reopening again based on conversation had in this thread:

https://github.com/StephenMiracle/frankenwp/discussions/16

Will provide an example and template for xdebug that follows the suggested pattern.

StephenMiracle commented 3 months ago

Hey @ngdangtu-vn & @PascaleBeier , can you check this PR when you have a chance. It's an example with xdebug enabled. Doesn't allow for multiple sites at this point. Will do that in another feature. https://github.com/StephenMiracle/frankenwp/pull/17/files