Is PHP debugging supposed to work?

I tried to debug a PHP application. I also tried the Symfony demo.

The first problem is that the Apache that gets launched by default does not have debugging enabled.

Then, in the debugger I can launch another instance, I can set a breakpoint, and execution stops there. But then the process dies. This is not helpful at all.

On https://www.gitpod.io/docs/languages/php/ the demo shown in the animated gif has only simple variable-setting code that runs once and exists. The demo does not even use the HTML Preview.

However, as we all know, PHP is used for websites where a request comes in and some code produces a response. And that response is shown in the HTML Preview where the server continues running. That is what I want to debug. Not simple variable-setting code.

So, my question is, after seeing PHP debugging advertised on the Gitpod website, is PHP debugging working at all for real applications?

Then, show me an example where this works.

Hello, sorry PHP debugging isn’t working for you. Could you send a link to the repository where the issue is occurring?

Hello, so basically what we would like to do is to have a server running (apache in this case) and the debug working in real time on the preview of the website.
So if I have a variable printed, but I rewrite the value of it in the console it should update on the live site without the server or debug stopping.
Used the PHP example gitpod to demonstrate it kind of https://github.com/tetsuroba/Gitpod-PHP-Debug

I’m not quite sure how this should work in the GitPod environment but it works in local VSC environment.
Kind of like in this video https://youtu.be/LNIvugvmCyQ

Thanks in advance.

So I got your example working on the basis that I can see the variables set and stuff however the website does not render in real time as the response doesn’t seem to be sent until after the PHP script is run, however they way XDebug seems to work is that it must call to PHP I got your example running with php -S localhost:8080 -t public/ then starting the listen for XDebug thing in the debug menu, creating a breakpoint, and finally making a request it should then stop on the breakpoint letting you see the variables

Let me know if this helps!

We gave up. The environment is too limited. Not even email sending worked because of port limitation. No ssh.