_php techniques for configuring PHP+MYSQL environments under Mac OS

Source: Internet
Author: User
Tags configuration php mysql in phpmyadmin

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

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

Open the Terminal input command first:

Copy Code code as follows:

sudo vim/etc/apache2/httpd.conf

And one of the lines is this.

Copy Code code as follows:

#LoadModule Php5_module libexec/apache2/libphp5.so

Remove the front # number.

Then open the share in System preferences, hook up the Web share, as shown below

Restart Apache with the following command:

Copy Code code as follows:

sudo apachectl restart

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

It works!

Instructions for successfully configuring the PHP environment

Below to configure the MySQL environment.

First download MySQL's DMG installation package. Download address in: http://dev.mysql.com/downloads/mysql/

Open the DMG file, which has three installation items, I have three installed, Mysqlstartupitem.pkg installed, MySQL will start with the system boot, Mysql.prefpane said you can see the system Preferences in the MySQL option, there is a MySQL installation.

This makes the installation successful, opens MySQL in System Preferences, and opens the service. When installed, the default username is root and the password is blank. For security, we set a password.

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

Enter in the terminal

Copy Code code as follows:

sudo vim/etc/bashrc

And then join the

Copy Code code as follows:

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

As a result, enter MySQL in the terminal has this command, in fact, it and our C/s + + macro definition somewhat similar to the role of alias substitution.

We then modify the root password, which commands the following:

Copy Code code as follows:

Mysqladmin-uroot Password 12345

This will change the root password to 12345.

To manage MySQL, if the command line is more troublesome, open source phpMyAdmin adopt C/S mode, convenient management. Then we'll install a phpmyadmin. It is developed by PHP, the download address is: http://www.phpmyadmin.net/home_page/downloads.php

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

And then enter the command:

Copy Code code as follows:

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

Follow these changes:

Copy Code code as follows:

$cfg [' blowfish_secret '] = ';//for Cookie encryption, random long string
$cfg [' Servers '] [$i] [' host '] = ' '; the//mysql daemon made IP bindings

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

Name of service: root

Password for you to set the password.

You can login to MySQL's admin interface.

OK, the above is in the Mac OS configuration php+mysql the entire content of the environment, I hope the small partners can like.

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.