Safari can’t open the page “http://localhost/”

Lachman

macrumors newbie
Original poster
Aug 22, 2008
26
0
The Netherlands
Hey Guys,
I am new with jusing mac's.
I have this mac now almost 2 months and i love it! :D
And i wanted to start working with PHP on my mac.
So i found a tutorial on the internet how to "activate" php.

This is the website -> http://foundationphp.com/tutorials/php_leopard.php

Afther doing everything step by step i was done...
Then i restarted Apache and typed in Localhost and now it says i can't connect to it...:confused:

This is the error that is showing -> Safari can’t open the page “http://localhost/” because it can’t find the server “localhost”.

Please help :confused:

Thnx for reading
 

MoreBS

macrumors newbie
Apr 29, 2008
29
0
Does 127.0.0.1 work?

If 127.0.0.1 works, then open NetInfo Manager (in Utilities).

In the left column, click on "machines"

In the middle column, select "localhost" and make sure the property of ip_address is set to 127.0.0.1
name should be "localhost"
 

Lachman

macrumors newbie
Original poster
Aug 22, 2008
26
0
The Netherlands
Well i did the next thing so solve the problem...
i formatted my hard drive and installed my osx all over agian.
And then i had a back up from time machine so i still have everything and my local host is working agian :D
 

benwedge

macrumors newbie
May 28, 2008
10
0
Same issue

Hmmm... I was trying to install MySQL yesterday, and all of a sudden, at the end, my Apache server chose to stop working. After a day of stress trying to get the MySQL to work, I decided I'd just go back to square one, and last night recovered from a time machine backup from the morning before I started reconfiguring stuff. Now my server still doesn't work.

I've definitely checked to make sure the server was active in the sharing tab, but it's very strange that my computer didn't recover to the state it was in at the time the backup was made.

Is a fresh install of the OS, then recovery from Time Capsule the only option?
 

epochblue

macrumors 68000
Aug 12, 2005
1,671
0
Nashville, TN
Are you sure there aren't any errors in your Apache config file?

After you've turned on Web Sharing, I'd recommend opening up Console.app (in /Applications/Utilities) and checking the console.log for anything Apache related.
 

benwedge

macrumors newbie
May 28, 2008
10
0
I didn't have a problem with the server up until I tried to install MySQL.

The console.app shows many things about Apache:
"27/08/08 7:57:59 PM com.apple.launchd[1] (org.apache.httpd[14996]) Exited with exit code: 1"
"27/08/08 7:58:09 PM org.apache.httpd[15024] [Wed Aug 27 19:58:09 2008] [warn] module php5_module is already loaded, skipping"
"27/08/08 7:58:09 PM org.apache.httpd[15024] (2)No such file or directory: httpd: could not open error log file /private/var/log/apache2/error_log. "

those are coming up repeatedly. If anyone has an idea of what the problem could be, any help is appreciated!
 

eagleyeh

macrumors newbie
Aug 27, 2008
2
0
I am using MAMP
and my local server is localhost:8888
nothing will show without the port number
 

scottmeves

macrumors newbie
Nov 26, 2006
5
0
[SOLVED] apache localhost not working with web sharing enabled

I didn't have a problem with the server up until I tried to install MySQL.

The console.app shows many things about Apache:
"27/08/08 7:57:59 PM com.apple.launchd[1] (org.apache.httpd[14996]) Exited with exit code: 1"
"27/08/08 7:58:09 PM org.apache.httpd[15024] [Wed Aug 27 19:58:09 2008] [warn] module php5_module is already loaded, skipping"
"27/08/08 7:58:09 PM org.apache.httpd[15024] (2)No such file or directory: httpd: could not open error log file /private/var/log/apache2/error_log. "

those are coming up repeatedly. If anyone has an idea of what the problem could be, any help is appreciated!
The solution to this specific problem, which I faced as well, was to create the directory /private/var/log/apache2 as root, at which point the errors went away and my webserver began working again.
 

Orngarth

macrumors newbie
Jan 8, 2008
5
0
Restoring localhost access after system retore

I installed OS X 10.6 (Snow Leopard) and it broke my local Mediawiki installation (which I use as my own personal knowledge-base). I scoured the internet looking for a solution but none of the suggestions I found worked (e.g. reverting to earlier versions of php, tweaking various parameters in config files, etc.). So I did a full restore of OS X 10.5 (Leopard) using a time machine backup, but after the restore I got the following error:

Safari can’t open the page “http://localhost/~me/wiki/index.php/Main_Page” because Safari can’t connect to the server “localhost”.

After reading the above posts, I checked the console and sure enough was getting a lot of errors from Apache. I manually added the directory it couldn't find ($ sudo mkdir /private/var/log/apache2) and it fixed the problem! My Mediawiki is now back up and running! Thanks MacRumors Forums!!! =)

PS - If anyone has had any luck getting Mediawiki to run in Snow Leopard, I'd appreciate any tips you could give.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.