PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Nov 26, 2014 2:23 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Feb 14, 2009 3:30 pm 
Offline
DevNet Resident
User avatar

Joined: Thu Jan 13, 2005 7:44 pm
Posts: 2341
Location: Sarasota Florida
I'm trying to get the $_SERVER['SERVER_ADDR'] as 192.168.abc.xyz though it keeps coming up at 127.0.0.1. The reason is I'm trying to make the base element echo out the server's IP on a local network so I don't have to change the IP manually every time the network changes. Obviously if I try to load the page up on a different system then it will attempt to load the files adding the base element's href attribute's value as being on the same system instead of the server. I've tried messing around in the hosts file (system32\drivers\etc) however nothing seemed to work there. All the threads on forums I keep coming across always burn out before anything useful. Suggestions please?


Top
 Profile  
 
PostPosted: Sat Feb 14, 2009 3:37 pm 
Offline
Site Administrator
User avatar

Joined: Sun May 19, 2002 10:24 pm
Posts: 6875
Hmm, maybe you have to change the IP in httpd.conf.

_________________
Image


Top
 Profile  
 
PostPosted: Sat Feb 14, 2009 3:54 pm 
Offline
DevNet Resident
User avatar

Joined: Thu Jan 13, 2005 7:44 pm
Posts: 2341
Location: Sarasota Florida
Looks like you're correct though I'm not sure what dynamic value to place here...

Syntax: [ Download ] [ Hide ]
ServerName localhost:80
#ServerName 192.168.1.101:80
#ServerName 127.0.0.1:80


I'm reading about the servername though I've never really found Apache's documentation understandable though if I find the answer I'll obviously post it here.


Top
 Profile  
 
PostPosted: Sat Feb 14, 2009 4:45 pm 
Offline
DevNet Resident
User avatar

Joined: Thu Jan 13, 2005 7:44 pm
Posts: 2341
Location: Sarasota Florida
Pilot error! I was not requesting from a network IP however once I did everything seemed to work fine. I commented out all my hosts and httpd.conf changes, restarted the Apache service, and everything runs clean. When I changed my network IP it still ran smoothly so I've resolved the issue.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group