Build Apache, PHP, and MySQL Web servers on Mac OS x

Source: Internet
Author: User
Tags install homebrew

Build a Web server development environment for Apache, PHP, and MySQL on Mac OS x.

Tools/Materials
    • Mac OS X 10.10
    • Homebrew Software
Method/Step
  1. 1. How do I turn on Apache server?

    There are two ways to open a Web server:

    One is: Open Web share (web sharing), "System Preferences (Preferences)", "Sharing (sharing)".

    Another: Open by running Apache's start command directly on the terminal terminal: sudo apachectl start.

    I did not find the Web sharing on my Mac OS X 10.9.5, so I can only open the server in the second way.

    Apache server Default Web root directory in:/library/webserver/documents.

    Apache configuration file in:/etc/apache2.

  2. 2. Open the PHP module

    Because Mac OS X has built-in PHP, we just need to load the PHP module in Apache's configuration. Methods such as:

    1) run at Terminal: sudo vi/etc/apache2/httpd.conf, open Apache config file.

    2) Find #loadmodule Php5_module libexec/apache2/libphp5.so Similar entry, remove the note #, and save it.

    3) terminal run: sudo apachectl restart, restart Apache server.

  3. 3. Install and start MySQL

    1) Install MySQL using homebrew:

    Install the software on Mac OS X, you can directly find the relevant IMG installation, can also be like Ubuntu apt-get similar convenience, can use the brew install.

    Of course, using this feature, you need to install homebrew, the installation method is:

    Run command at Terminal: RUBY-E "$ (Curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)".

    Install MySQL, run at Terminal: Brew install MySQL.

    The BREW program will automatically install the MySQL dependent Library OpenSSL and then install MySQL, which I installed is: mysql-5.6.2.

    2) Start MySQL:

    Based on the instructions above, start MySQL, run at Terminal: Mysql.server start. After successful startup, use: Mysql-uroot to connect to MySQL database.

    END

Build Apache, PHP, and MySQL Web servers on Mac OS x

Related Article

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.