Configure the Apache + Php + Mysql environment on Mac

Source: Internet
Author: User
Configure the Apache + Php + Mysql environment on Mac, and configure Apache and PHP.

Same as OSX, Mavericks comes with apache2.2.24 and php5.4.17, but it is not enabled by default. Open the terminal

sudo apachectl start

Enter localhost in the browser, and apache standard It Works will appear!
Next, enable php and modify the apache configuration file.

sudo vim /etc/apache2/httpd.conf

Find
# LoadModule php5_module libexec/apache2/libphp5.so, remove the previous #
The default www folder is very inconvenient, but it is easy to develop it in home, modifying apache configuration
, Or the above File

# Change the directory in the quotation marks to your own directory DocumentRoot "/Library/WebServer/Documents"... # change the directory in the quotation marks to the same directory as the one above.
 

Create File index. php In your directory and write

 

Accessing localhost in a browser should display the php info page

 

 

Installation and configuration of MySQL and phpMyAdmin

Go to the MySQL official website to download the latest MySQL version ghost. For ease of operation, you can add an alias for MySQL:

alias mysql=/usr/local/mysql/bin/mysqlalias mysqladmin=/usr/local/mysql/bin/mysqladmin

Set the password later

Mysqladmin-uroot password "password"

For convenience, you can use phpMyAdmin for graphical operations.
Success!

 

Ps: Reprinted from http://www.kankanews.com/ICkengine/archives/100966.shtml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.