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

Discussion in 'Mac Basics and Help' started by Lachman, Aug 22, 2008.

  1. Lachman macrumors newbie

    Lachman

    Joined:
    Aug 22, 2008
    Location:
    The Netherlands
    #1
    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
     
  2. Lachman thread starter macrumors newbie

    Lachman

    Joined:
    Aug 22, 2008
    Location:
    The Netherlands
    #3
    Done that and it still says -> Safari can’t open the page “http://localhost/” because it can’t find the server “localhost”.
    I still have a backup from Time Machine shall i recover it?
     
  3. MoreBS macrumors newbie

    Joined:
    Apr 29, 2008
    #4
    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"
     
  4. Lachman thread starter macrumors newbie

    Lachman

    Joined:
    Aug 22, 2008
    Location:
    The Netherlands
    #5
    http://127.0.0.1/ doesn't work....
    I rebooted my Mac restarted Apache and nothing helped...
     
  5. ergdegdeg Moderator emeritus

    ergdegdeg

    Joined:
    Oct 13, 2007
    #7
    Just to make sure, have you ticked Web Sharing in System Prefs?
     
  6. Lachman thread starter macrumors newbie

    Lachman

    Joined:
    Aug 22, 2008
    Location:
    The Netherlands
    #8
    Web sharing is active ;)
    But still the same error...:mad:
     
  7. Lachman thread starter macrumors newbie

    Lachman

    Joined:
    Aug 22, 2008
    Location:
    The Netherlands
    #9
    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
     
  8. benwedge macrumors newbie

    Joined:
    May 28, 2008
    #10
    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?
     
  9. epochblue macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN
    #11
    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.
     
  10. benwedge macrumors newbie

    Joined:
    May 28, 2008
    #12
    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!
     
  11. eagleyeh macrumors newbie

    Joined:
    Aug 27, 2008
    #13
    I am using MAMP
    and my local server is localhost:8888
    nothing will show without the port number
     
  12. Lachman thread starter macrumors newbie

    Lachman

    Joined:
    Aug 22, 2008
    Location:
    The Netherlands
    #14
    Well create a new account then it also will work agian ;)!
     
  13. scottmeves macrumors newbie

    scottmeves

    Joined:
    Nov 26, 2006
    #15
    [SOLVED] apache localhost not working with web sharing enabled

    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.
     
  14. Orngarth macrumors newbie

    Joined:
    Jan 8, 2008
    #16
    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.
     

Share This Page