Welcome to WebDesignForums.net!
You're currently viewing WDF as a guest. By registering for a free account, you'll be able to participate with other members in our friendly community. Being a member allows you to ask questions and get answers for those troublesome web development tasks!

In addition, as a member you'll be able to post your websites up for review. Using our unique website review system you can gain some amazing feedback from some of the best web developers around. This is a completely free service to all registered members.

Ready to register yet? Registration is 100% free. Click Here To Join Now!

Install php and mysql on Mac OSX step by step

Discussion in 'Software Articles & Tutorials' started by iphong, May 27, 2003.

  1. Offline

    iphong Graphic Designer

    Message Count:
    751
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Arlington, VA
    _Install PHP module in mac OSX:

    Follow these steps to install php module in your mac. (this version only supports Mac OSX 10.2.x if you are using Mac OSX 10.1.x the older version still available on php.net for you to download).

    Step 1: Install PHP module:
    Open a terminal window

    shell~> curl -O http://www2.entropy.ch/download/libphp4.so.gz __ //wait for download to finish//
    shell~> gunzip libphp4.so.gz
    shell~> sudo mv libphp4.so /usr/libexec/httpd/

    Step2: Activating the PHP Module
    Open a terminal window

    shell~> cd /etc/httpd
    shell~> sudo apxs -e -a -n php4 libexec/httpd/libphp4.so


    On OS X prior to 10.2, type
    shell~> sudo perl -p-i.bak -e 's%#(AddType \S+-php[ -])%$1%i' httpd.conf
    On OS X 10.2, type
    shell~> echo 'echo "AddType application/x-httpd-php .php" >> /etc/httpd/httpd.conf' | sudo sh -s
    (Note: Don't type this by hand, do a copy/paste from this web page directly to the terminal)

    then finally type in
    shell~>sudo apachectl graceful __ //to restart the web server //


    PHP should now ready to use, you can test this by make a file with this content:

    [code:<? echo ("hello world")?> ]

    Then save it into your "/users/Sites/" folder with name "hello.php". then use your browser to open http://127.0.0.1/~your_short_username/test.php. If you can see the hello world text is mean php module is installed in your server .


  2. Offline

    iphong Graphic Designer

    Message Count:
    751
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Arlington, VA
    Install MySQL server:

    __Step 1: download mySQL version on mysql.com
    Here is version mySQL 4.0 from mySQL.com ( mysqlmax - 6.6Mb) - ( Mysqlstandard - 7.2Mb) - ( Mysqldebug - 16.5Mb). After downloaded mount the dmg file then run install.

    __step 2: Activate mysql server
    MySql requires useraccount named "mysql" which already have in mac osx 10.2.x(you need to creat it in mac osx 10.1 or older)

    _then open a terminal window type in this:

    shell~> cd /usr/local/mysql
    shell~> sudo ./bin/mysqld_safe
    password:__ //Enter your administrator password//
    dont wait, Press CTRL+Z immediately - mySQL server should now be activated, and started.

    You should now be able to connect to the MySQL server, e.g. by running:

    shell~> /usr/local/mysql/bin/mysql

    Everything should be ok now, good luck and have fun with it. :)


  3. Offline

    iphong Graphic Designer

    Message Count:
    751
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Arlington, VA


  4. Offline

    Durer New Member

    Message Count:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I get the reply: No such file or directory
    MySQL installed itself under Library/MySQL

    what to do?


  5. Offline

    zionlocke Master of the Fu!

    Message Count:
    736
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    .: l33t Basement :.
    i'm new to mac osx, how to open a term? i'm finally trying it out on campus.


Share This Page