Remote server vs local server setting
if($_SERVER['REMOTE_ADDR']=="127.0.0.1")
{
<pick local setti开发者_C百科ng - my test machine >
}
else
{
<pick webserver setting - my site on webserver>
}
When I debug my application, the setting on my local system goes into the else block? From the code that I see, it should go into the first block. This is happening when I debug the application. Otherwise, everything seemed to be fine.
I have brought my live website into my local machine. The website works fine until I go into debugging mode and saw this. The debugger dies every time because the sql server connection fails. I wonder why it is like this? Running the website otherwise is OK. Is it a special behavior in debugging mode, or there something to point about in the code?
I am using PHP, Eclipse Helios and XDebug.
You should check your apache server configuration;mainly it listens for either localhost or 127.0.0.1 or 192.168.1.1 or something else, and the iptables (firewall in linux situation) redirects the other hostnames to the main address, double check your configuration !
精彩评论