Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStorm cannot use xdebug #141

Closed
withinboredom opened this issue Feb 18, 2023 · 6 comments · Fixed by #168 or #214
Closed

PHPStorm cannot use xdebug #141

withinboredom opened this issue Feb 18, 2023 · 6 comments · Fixed by #168 or #214

Comments

@withinboredom
Copy link
Collaborator

This is probably on PHPStorm, but it fails to do remote step debugging because $_SERVER['SERVER_PORT'] is unset.

From looking at the code around https://github.com/dunglas/frankenphp/blob/main/cgi.go#L126, it looks like it should be set, but a simple var_dump($_SERVER) shows that it is indeed, not set.

@withinboredom
Copy link
Collaborator Author

I filed https://youtrack.jetbrains.com/issue/WI-71443 with them as well.

@dunglas
Copy link
Owner

dunglas commented Feb 18, 2023

We should also fix it on our side, we can easily set this variable.

@withinboredom
Copy link
Collaborator Author

It works fine when it is truly remote (like running on a server). I only get this error when running on localhost or with a wildcard SERVER_NAME, like :80. Seems to be set properly when SERVER_NAME is an actual domain.

@francislavoie
Copy link
Contributor

FWIW, in Caddy's fastcgi transport, we made a change to ensure a default of 80 or 443 is set for SERVER_PORT in caddyserver/caddy#4572 based on the incoming request's scheme. It looks like that code was copied from Caddy (identical comment) so I suggest it can be updated to match.

@dunglas
Copy link
Owner

dunglas commented Mar 4, 2023

Yes it was. Maybe could we share it in some way btw.

@francislavoie
Copy link
Contributor

We have caddyserver/caddy#4378 which is related to that, i.e. splitting out the fastcgi transport to its own package. If you'd like to help with that, that'd be cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants