PHP Storm Debugging Creates Empty Server Definitio

2019-04-10 10:28发布

问题:

Something seems to have broken in my PHP Storm IDE. When I try and debug using the listener, Storm loads the "Incoming connection from Xdebug" dialog but, the server name text field is empty. I can specify the file to debug but, nothing happens in the IDE. I can see that Storm is debugging the file in the stack trace but, it isn't mapping to the file in my IDE.

When I check the server configuration in Storm, it has created a nameless server definition. If I complete this definition, select it, and try debugging again, Storm just creates another empty server definition.

I have been successfully debugging with Storm for many years so I'm really unsure what has happened to cause this behaviour. Any help would be appreciated.

Thanks.

回答1:

So .. your web server software is nginx.

This issue must be fixed in nginx config file. Thing is: nginx does not provide value for $_SERVER["SERVER_NAME"] (in PHP terms) which is used by PhpStorm to determine what config to use during debug.

Check this thread (last few posts) about how to fix it: http://devnet.jetbrains.com/message/5494835#5494835

Something like fastcgi_param SERVER_NAME $host; should do the job.



回答2:

i set a "server_name xxx.foo.com;" attribute in nginx configure file solve this problem