Table of Contents
Configuring PHP+MySql environment under Mac OS
Home Backend Development PHP Tutorial Configuring PHP+MySql environment under Mac OS_PHP tutorial

Configuring PHP+MySql environment under Mac OS_PHP tutorial

Jul 13, 2016 am 10:06 AM
mac php+mysql Down exist environment detailed Configuration

Configuring PHP+MySql environment under Mac OS

This article details the detailed steps for installing and configuring PHP+MySql environment under mac OS system. It is very comprehensive and is recommended here for those who have the same experience. Friends in need.

Since mantis recently needs to be deployed for bug tracking, the process is recorded here.

Since the PHP apache environment comes with Mac OS, there is no need to install the installation package elsewhere, just a simple configuration.

First open the terminal and enter the command:

The code is as follows:


sudo vim /etc/apache2/httpd.conf

There is a line like this

The code is as follows:


#LoadModule php5_module libexec/apache2/libphp5.so

Remove the # sign in front.

Then open Sharing in System Preferences and check web sharing, as shown below

Mac OS下配置PHP+MySql环境  帮客之家

Restart apache, the command is as follows:

The code is as follows:


sudo apachectl restart

In this way, you can enter http://localhost/ in the browser, and if

appears

It works!

Description of successfully configuring the php environment

Let’s configure the MySql environment.

First download the dmg installation package of MySql. The download address is: http://dev.mysql.com/downloads/mysql/

Open the dmg file. There are three installation items in it. I installed all three here. After MySQLStartupItem.pkg is installed, mysql will start automatically when the system starts. MySQL.prefPane indicates that the mysql option can be seen in the system preferences. , and the other one is the mysql installation item.

In this way, the installation is successful. Open mysql in the system preferences and enable the service. After installation, the default username is root and the password is empty. For security, we set a password.

Open the terminal. If you enter mysql and you are prompted that there is no such command, you need to configure the environment variables of the mysql bin directory. The directory is, /usr/local/mysql/bin/, add it to the PATH variable. Here I introduce another method,

Enter

in the terminal

The code is as follows:


sudo vim /etc/bashrc

Then add

in it

The code is as follows:


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

In this way, if you enter mysql in the terminal, you will have this command. In fact, it is somewhat similar to the macro definition in our C/C++, and the alias is used instead.

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

The code is as follows:


mysqladmin -uroot password 12345

This will change the root password to 12345.

To manage Mysql, if it is troublesome to use the command line, the open source phpMyAdmin adopts C/S mode for easy management. Then we install phpMyAdmin. It is developed by php, and the download address is: http://www.phpmyadmin.net/home_page/downloads.php

Put the downloaded unzipped file in the /Library/WebServer/Documents/ directory. The complete directory is: /Library/WebServer/Documents/phpmyadmin/, then enter this directory with the command line,

Enter the command:

The code is as follows:


cp config.sample.inc.php config.inc.php
vim config.inc.php

Make changes as follows:

The code is as follows:


$cfg['blowfish_secret'] = '';//For cookie encryption, any long string
$cfg['Servers'][$i]['host'] = '127.0.0.1';//MySQL daemon does IP binding

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

Server name: root

The password is the password you set.

You can log in to the mysql management interface.

Okay, the above is all about configuring the PHP+MYSQL environment in MAC OS. I hope you guys like it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/960576.htmlTechArticleConfiguring PHP+MySql environment under Mac OS This article details the detailed steps to install and configure PHP+MySql environment under mac OS system Zou, very comprehensive, recommended here to friends who have the same needs. ...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

3 tips to easily customize your Mac computer name, host name and Bonjour name 3 tips to easily customize your Mac computer name, host name and Bonjour name Mar 06, 2024 pm 12:20 PM

Many Mac users tend to keep the default name of their device and may never consider changing it. Many people choose to stick with the name from the initial setup, such as "Johnny's MacBook Air" or simply "iMac." Learning how to change the name of your Mac is a very useful skill, especially when you have multiple devices, as it can help you quickly distinguish and manage them. Next, we will teach you step by step how to change the computer name, host name and Bonjour name (local host name) in macOS system. Why should you change your Mac name? Changing the name of your Mac can not only show your personality, but also help improve the user experience: Personalize your Mac: The default name may not be to your taste, change it to a name you like.

The working principle and configuration method of GDM in Linux system The working principle and configuration method of GDM in Linux system Mar 01, 2024 pm 06:36 PM

Title: The working principle and configuration method of GDM in Linux systems In Linux operating systems, GDM (GNOMEDisplayManager) is a common display manager used to control graphical user interface (GUI) login and user session management. This article will introduce the working principle and configuration method of GDM, as well as provide specific code examples. 1. Working principle of GDM GDM is the display manager in the GNOME desktop environment. It is responsible for starting the X server and providing the login interface. The user enters

Understand Linux Bashrc: functions, configuration and usage Understand Linux Bashrc: functions, configuration and usage Mar 20, 2024 pm 03:30 PM

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

How to set up WeChat Mac to automatically convert voice messages into text - How to set up voice to text conversion How to set up WeChat Mac to automatically convert voice messages into text - How to set up voice to text conversion Mar 19, 2024 am 08:28 AM

Recently, some friends have consulted the editor about how to set up WeChat Mac to automatically convert voice messages into text. The following is a method for setting up WeChat Mac to automatically convert voice messages into text. Friends in need can come and learn more. Step 1: First, open the Mac version of WeChat. As shown in the picture: Step 2: Next, click "Settings". As shown in the picture: Step 3: Then, click "General". As shown in the picture: Step 4: Then check the option "Automatically convert voice messages in chat to text". As shown in the picture: Step 5: Finally, close the window. As shown in the picture:

3 Ways to Convert HEIC Photos to JPG on Mac 3 Ways to Convert HEIC Photos to JPG on Mac Mar 15, 2024 pm 08:43 PM

By default, iPhone takes photos from the camera in HEIC format. HEIC stands for High Efficiency Image Container and can hold more pixel data than PNG or JPG files, taking up significantly less space on iPhone storage compared to other formats. These files work best on iPhones but are not widely accepted on the internet because they often result in blurry/grainy pictures when you share them with non-Apple devices. To ensure that HEIC images are compatible on other devices, you may need to convert them to JPG format. This article will introduce how to convert HEIC images to JPG on Mac. How to Convert HEIC Photos to JPG on Mac [3 Methods] Method

How to post to Moments on WeChat Mac - How to post to Moments on WeChat Mac How to post to Moments on WeChat Mac - How to post to Moments on WeChat Mac Mar 18, 2024 pm 05:43 PM

Friends, do you know how to post Moments on WeChat Mac? Today I will explain how to post Moments on WeChat Mac. If you are interested, come and take a look with me. I hope it can help everyone. Step 1: After opening WeChat, click the Moments button on the left. Step 2: Next, click the camera button on the upper right side. Step 3: Enter the text content you want to send. Step 4: Next, click on who can watch. Step 5: In the pop-up box, select the viewable conditions and click OK. Step 6: Finally, click the Publish button.

MyBatis Generator configuration parameter interpretation and best practices MyBatis Generator configuration parameter interpretation and best practices Feb 23, 2024 am 09:51 AM

MyBatisGenerator is a code generation tool officially provided by MyBatis, which can help developers quickly generate JavaBeans, Mapper interfaces and XML mapping files that conform to the database table structure. In the process of using MyBatisGenerator for code generation, the setting of configuration parameters is crucial. This article will start from the perspective of configuration parameters and deeply explore the functions of MyBatisGenerator.

How to format a drive using GUID on Mac How to format a drive using GUID on Mac Apr 12, 2024 am 09:13 AM

Formatting the drive of your Mac system is crucial for proper functioning. It helps prevent various system problems and makes your Mac more stable overall. While naturally Mac supports various partitioning schemes, GUID offers more modern and versatile features compared to other options. Also essential for newer Macs and supports larger drives, giving you the best compatibility and stability. This guide will take an in-depth look at how to format a drive using a GUID on macOS. That said, let's get started. Why GUID is important for macOS installation A GUID (full form of Globally Unique Identifier) ​​is a partitioning scheme that helps install and run the macOS operating system. It is better than traditional MBR (main lead

See all articles