Guide to MAMP and setting up my own server

Discussion in 'Web Design and Development' started by kitki83, Sep 22, 2008.

  1. kitki83 macrumors 6502a

    Joined:
    Mar 31, 2004
    Location:
    Los Angeles
    #1
    I am taking a PHP course and the instructor recommended we try setting up a localhost but our textbook has different approach. We where instructed to use LAMP, WAMP or MAMP depending on our system.

    I just installed MAMP and running but not sure how is the localhost setup suppose to be, can I just open php file having phpInfo(); and get results. So far FF3 just shows the Header html.

    Can someone give me a guide to setting up and able to run my own local server?

    PHP:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Hello in PHP</title>
    </head>

    <body>
    <h1>Hello in PHP</h1>
    <?
    print "Hello, world!";
    phpInfo();
    ?>

    </body>
    </html>

    Aside from this is it possible to create Flash website using readfile(text.txt); for the content?
     
  2. tominated macrumors 68000

    tominated

    Joined:
    Jul 7, 2006
    Location:
    Queensland, Australia
    #2
    put all the files for the website in /Applications/MAMP/htdocs and you should be ready to go.
     
  3. kitki83 thread starter macrumors 6502a

    Joined:
    Mar 31, 2004
    Location:
    Los Angeles
    #3
    That's where I saved the file as php at. Still will not showing the PHP portion. I am running MAMP while doing it.
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    Are you opening http://localhost/ ? As long as a index.php file is inside the htdocs folder that should do the trick. If it has a different name then type that in at the end. Also, just in case, make sure to open up the MAMP control panel and turn on the servers.
     
  5. Poeben macrumors 6502

    Joined:
    Jul 29, 2004
    #5
    1. MAMP runs on it's own port, 8888 by default. Keep that in mind in your urls.
    2. Short php tags may be disabled by default in MAMP. I don't recall to be honest.
     
  6. kitki83 thread starter macrumors 6502a

    Joined:
    Mar 31, 2004
    Location:
    Los Angeles
    #6
    I figured it out for future reference what I did is click on home page of MAMP
    which took me to
    http://localhost:8888/MAMP/?language=English

    I then saw the port number so that was my missing part
    http://localhost:8888/hello.php

    and loaded my site just as I wanted.

    Thank you all for the tips and advice.
     
  7. Volante macrumors regular

    Joined:
    Feb 8, 2008
    #7
    What I usually do this use the "Reset to Apache/MySQL default"-button under Preferences -> Ports. hello localhost :)
     
  8. myjay610 macrumors regular

    Joined:
    Jan 6, 2008
    #8
    Did you actually try running the MAMP application that comes with it? It lets you easily configure things like the port number, WWW root, etc. It should be in your applications folder.
     

Share This Page