Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Storm Debugging Creates Empty Server Definitions

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.

like image 582
user1493194 Avatar asked Apr 28 '14 14:04

user1493194


2 Answers

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.

like image 76
LazyOne Avatar answered Sep 28 '22 12:09

LazyOne


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

like image 20
junfei wang Avatar answered Sep 28 '22 10:09

junfei wang