_php tutorial for configuring PHP+MYSQL environments under Mac OS

Source: Internet
Author: User
Tags configuration php

Configuring the PHP+MYSQL environment under Mac OS


This article introduces in detail the detailed step hygienic handrub of installing the configuration Php+mysql environment under Mac OS System, which is very comprehensive, it is recommended to the small partners who have the same needs.

Because of the recent need to decorate mantis for bug tracking, the process is documented here.

Because the PHP Apache environment is self-bringing on Mac OS, there is no need to install another package, simply configure it.

First open the Terminal input command:

The code is as follows:


sudo vim/etc/apache2/httpd.conf

One of them is like this.

The code is as follows:


#LoadModule Php5_module libexec/apache2/libphp5.so

Remove the previous # number.

Then open the share in System Preferences, put the Web share on the hook, as

To restart Apache, the command is as follows:

The code is as follows:


sudo apachectl restart

This allows you to enter http://localhost/in the browser, if any

It works!

Description of the successful configuration of the PHP environment

Below to configure the MySQL environment.

Download the DMG installation package for MySQL first. Download address in: http://dev.mysql.com/downloads/mysql/

Open the DMG file, there are three installation items, which I installed in three, Mysqlstartupitem.pkg after installation, MySQL will start with the system boot, Mysql.prefpane indicates that you can see the MySQL option in System Preferences, and one is the MySQL installation.

This will make the installation successful, turn on MySQL in System Preferences, and turn the service on. After installation, the default username is root and the password is empty. For security, we set a password.

Open the terminal, if you enter the MySQL prompt without this command, then you need to configure the MySQL Bin directory environment variables. The directory is,/usr/local/mysql/bin/, added to the path variable. Here I'll show you another way,

Enter in the terminal

The code is as follows:


sudo vim/etc/bashrc

And then join them in

The code is as follows:


#mysql
Alias mysql= '/usr/local/mysql/bin/mysql '
Alias mysqladmin= '/usr/local/mysql/bin/mysqladmin '

In this way, in the terminal to enter MySQL has this command, in fact, it is similar to our macro definition in C + +, the role of alias substitution.

Then we change the root password, the command is as follows:

The code is as follows:


Mysqladmin-uroot Password 12345

This changes the root password to 12345.

To manage MySQL, if the command line is more troublesome, open source phpMyAdmin use C/s mode, easy to manage. Then we put on a phpmyadmin. It was developed by PHP and the download address is: http://www.phpmyadmin.net/home_page/downloads.php

The downloaded decompression is placed in the/library/webserver/documents/directory, the complete directory is:/library/webserver/documents/phpmyadmin/, then the command line into this directory,

Re-enter the command:

The code is as follows:


CP config.sample.inc.php config.inc.php
Vim config.inc.php

Follow the changes below:

The code is as follows:


$cfg [' blowfish_secret '] = ';//for Cookie encryption, random long string
$cfg [' Servers '] [$i] [' host '] = ' 127.0.0.1 ';//mysql daemon does IP binding

You can now enter url:http://localhost/phpmyadmin/in the browser

The service name is: root

Password for the password you set.

You can login to the MySQL admin interface.

Well, the above is the whole content of configuring the PHP+MYSQL environment in Mac OS, I hope the small friends can enjoy it.

http://www.bkjia.com/PHPjc/960576.html www.bkjia.com true http://www.bkjia.com/PHPjc/960576.html techarticle Configuring the PHP+MYSQL environment under Mac OS This article describes in detail step hygienic handrub of installing the configuration Php+mysql environment under Mac OS System, which is very comprehensive and recommended for small partners with the same needs. ...

  • 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.