 |
 |
127.0.0.1 & machinename.local & http://localhost driving me nuts
|
 |
|
 |
|
Forum Regular
Join Date: Aug 2001
Status:
Offline
|
|
I am developing a PHP app on my local machine, have done so for a year or two no with no problems. For some reason now I am running into really strange problems with http://127.0.0.1/file.php resolving as http://mymachinename.local/file.php! No big deal right? Wrong, since the app uses sessions, the cookie domain must be consistant, so the domains going back and forwards causes me too lose the session cookie. It's really sporadic too, I can't seem to pinpoint what causes the address to resolve as .local
Any thoughts? I want 127.0.0.1 to resolve to 127.0.0.1, no ands ifs or buts about it.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Location: Finland
Status:
Offline
|
|
Originally posted by jetta_gt:
I am developing a PHP app on my local machine, have done so for a year or two no with no problems. For some reason now I am running into really strange problems with http://127.0.0.1/file.php resolving as http://mymachinename.local/file.php! No big deal right? Wrong, since the app uses sessions, the cookie domain must be consistant, so the domains going back and forwards causes me too lose the session cookie. It's really sporadic too, I can't seem to pinpoint what causes the address to resolve as .local
Any thoughts? I want 127.0.0.1 to resolve to 127.0.0.1, no ands ifs or buts about it.
Do you use any proxy servers? If you are try to add exceptions in the network settings preferences "proxy tab".
Example: localhost, 127.0.0.*
|
|
|
| |
|
|
|
 |
|
 |
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
how about specifying 127.0.0.1 as the ServerName in your httpd.conf? worth a shot. obviously, you'll need to reboot the server app afterwards, but i'm sure you know that
|
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Apr 2001
Status:
Offline
|
|
Try:
Applications > Utilities > Directory Access
...uncheck the Rendezvous box in the "Services" tab.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Status:
Offline
|
|
If it's only a session cookie, make your whatever work without that cookie and have less problems overall.
-
|
|
|
| |
|
|
|
 |
|
 |
|
Banned
Join Date: Apr 2002
Location: -
Status:
Offline
|
|
don't forget to sudo apachectl graceful!
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Aug 2002
Location: London, UK
Status:
Offline
|
|
Not sure if this will be of any help, but I seem to remember similar weird behaviour when working on local dev sites and it appeared to be related to whether a link included the trailing / in the url. Try experimenting and seeing if that has anything to do with it - or I might just be barking up the wrong tree.
Edit: Just took the time to actually read your post and realised that your referencing a file not a directory (with an index.php etc. in it) so my hint probably isn't very helpful
That'll teach me to post after a few pints 
(Last edited by tru322; Oct 14, 2003 at 05:10 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Aug 2001
Status:
Offline
|
|
Thanks everyone for you advice, in the end it was actually tru322's advice that seemed to help a lot, although I learned something from every reply, thanks guys, very helpful!!!
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Jan 2001
Location: california
Status:
Offline
|
|
in /etc/httpd/httpd.conf you probably want to change UseCanonicalName to "off"
here's the description from httpd.conf:
# UseCanonicalName: (new for 1.3) With this setting turned on, whenever
# Apache needs to construct a self-referencing URL (a URL that refers back
# to the server the response is coming from) it will use ServerName and
# Port to form a "canonical" name. With this setting off, Apache will
# use the hostname:port that the client supplied, when possible. This
# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|