MAMP: Can't view html/php pages

Discussion in 'macOS' started by iHobbs, May 5, 2011.

  1. iHobbs macrumors newbie

    iHobbs

    Joined:
    Feb 21, 2011
    #1
    I have just installed MAMP and created two pages: test.html and info.php. default.html is simply "<p>hello world</p>", and index.php is simply "phpinfo();". When I go to http://localhost:8888/ I see the two files in the folder. If I click on either of the two files I get a blank page. MAMP indicates that the Apache server is running.

    Any ideas as to why I'm getting blank pages?
     
  2. emiljan macrumors 6502

    emiljan

    Joined:
    Jan 25, 2010
    Location:
    Michigan
    #2
    i would try setting the ports to default instead of :8888. Then restart the server and try again.

    If that doesn't work install xampp which is exactly like mamp and test your web pages using that.
     
  3. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #3
    Make sure to surround your code with PHP tags. Also check the httpd.conf file and look for the line starting with DirectoryIndex. It should list "index.php" as one of the file names.
    PHP:
    <?php
    phpinfo
    ();
    ?>
     

Share This Page