Installing apache 2 / php 5 / my sql 5 on my mac

Discussion in 'Web Design and Development' started by guitarzanman, May 13, 2007.

  1. guitarzanman macrumors newbie

    Joined:
    Sep 9, 2006
    #1
    I am trying to install apache 2 / php /mysql on my mac but am having mega problems. I have tried every online instruction there is for installing apache 2 but none worked. THen I tried to install it using mac ports it downloaded and I think installed. BUt it still doesn't work it keeps say it can't find the server localhost when ever it type it in. Can some one please help me on how to properly install these so I can use them and get them to run at startup and not conflict with apache 1.3?? any help would be appreacted.

    Guitarzan man
     
  2. elppa macrumors 68040

    elppa

    Joined:
    Nov 26, 2003
  3. tschoftner macrumors member

    tschoftner

    Joined:
    Apr 14, 2007
    Location:
    Austria
    #3
    use MAMP

    I can only roger that. Try MAMP!
    try this link: http://www.mamp.info/en/home/

    Have used it for a while now; everthings works; and it's very good to try out php-pages before you load them onto a webserver!

    Thomas

    want: MBP 17" Santa Rosa:apple:
     
  4. nicksoper macrumors member

    nicksoper

    Joined:
    Mar 6, 2006
    Location:
    Cape Town
    #4
    Mamp!

    Mamp for sure. It's quick, easy, they have a dashboard widget!

    I found it does chow a lil of the system resources, but it's the price you pay for not having to upload everything.

    I'm not sure, but I'd appreciate if someone else could let me know, can you access the htdocs folder (php/apache environment) in parallels?
     
  5. macmanmatty macrumors regular

    Joined:
    Jul 10, 2005
    Location:
    (x,y)
    #5
    I tried mamp once and it sucks. It attempts to sell you things that you get easily elsewhere for free and on a limited basis allready have.

    Since I have some free time and You asked how to install apache / mysql / php I'm going give you step by step instructions on how to do this (how I did it).

    Fist make sure that have xcode/apple developer tools/ gcc and they are the latest versions. (If not you'll be getting many cryptic error messages later on in the process)

    If you don't have them you can get in nice package from apple here http://developer.apple.com/tools/xcode/
    You will and apple developer login to do this though

    Then download apache2 unix source code here http://httpd.apache.org/download.cgi

    extract it and using the terminal go into the directory where you extracted it. Then type the following into the terminal (if you wish to use a different layout or mods you can I have given you basic set and standard layout)

    Then after you finish typing that in type in this

    Then if that does not fail or give any errors, type

    If that works and gives no errors you have just installed apache.

    To start apache type this into the terminal (note: you will have to change the directory if you installed apache somewhere else)
    [quote type=this gtes typed into the terminal]
    sudo /usr/local/apache2/bin/apachectl start
    [/quote]
    and to stop apache type this
    Once you have started apache type this in your browser
    If apache is installed correctly and running you should see page displaying "It worked!"
    THis tells you that apache is running and installed correctly

    Now turn apache off to finish the rest of the installion



    Now we are ready to install mysql

    to do this
    download the lastest source code from http://dev.mysql.com/downloads/mysql/5.0.html#downloads. You can use their binary for mac if want but you will have to compile the source code anyway to get the shared libraries so I just compile it from the source code.

    to do that extract the source code and using the terminal go into the directory where the source code is.
    then type this in to the terminal (again you can use different build options or install mysql to a different directory)

    If all goes well and gives no errors

    then type this in to the terminal
    Then if that does not fail or give any errors, type

    If you Ain't got no errors the mysql was sucessfully installed

    To start mysql type this in to the terminal
    To access mysql type this in to the terminal
    Now turnm mysql off
    to complete the final step

    Finally we are ready to install php to do this get the latest version of php source code from here http://www.php.net/downloads.php

    the following the same process extract it and go in the directory where you extracted it using the terminal

    then type this into the terminal

    If all goes well and gives no errors

    then type this in to the terminal
    Then after you finish typing that in type in this

    Then if that does not fail or give any errors, type

    If you Ain't got no errors the php was sucessfully installed

    to use php with apache you must opnen your httpd.conf file (located in usr/local/apache2/conf/httpd.conf) in a text editotr and type this at the bottm of the file
    Now php will work with apache once it is turned on. To test php turn on apache and make a test page Containg this
    save it as somthing like test.php

    then run it using localhost://test.php

    If you get about of info about php that means that php is on and running correctly. You are now ready to start using apache/ php /mysql
     

Share This Page