Table of Contents
一。启动Apache
1.可视化配置
2.命令行方式
二。配置PHP
1.修改apache配置文件
2.设置php.ini
3.重启apache
三。安装MySql
1.下载安装并安装
2.设置密码
四。安装mcrypt
1.下载并解压libmcrypt-2.5.8.tar.bz2
2.编译
3.下载php源码文件(注意选择版本)
五。安装PhpMyAdmin
1.下载PhpMyAdmin
2.设置
Home php教程 php手册 MAC平台 Apache+PHP+MySql配置

MAC平台 Apache+PHP+MySql配置

Jun 06, 2016 pm 07:46 PM
mac start up platform Configuration

一。启动Apache 启动方式有两种: 1.可视化配置 在“系统偏号设置”-“共享”,选择互联网共享。(我没测试) 2.命令行方式 输入sudo apachectl start 这时在浏览器输入http://localhost,会显示It Works! Apache的主目录位置是在: Libary/WebServer/Docum

一。启动Apache

启动方式有两种:

1.可视化配置

在“系统偏号设置”-“共享”,选择互联网共享。(我没测试)

2.命令行方式

输入sudo apachectl start
Copy after login


这时在浏览器输入http://localhost,会显示It Works!

Apache的主目录位置是在:Libary/WebServer/Documents

二。配置PHP

1.修改apache配置文件

把/etc/apache2/httpd.conf

去掉#loadModule php5_module libexec/apache2/libphp5.so前的#号

2.设置php.ini

/etc/php.ini.default复制为/etc/php.ini,并按自己需求修改内容。

3.重启apache

在命令行运行sudo apachectl restart
Copy after login


三。安装MySql

1.下载安装并安装

下载地址:http://dev.mysql.com/downloads/mysql/ ,下载最新的DMG ARCHIEVE版本。安装以后会在系统偏号设置里有MySql图标。

2.设置密码

cd /usr/local/mysql/bin
sudo ./mysqladmin -u root -password root
Copy after login


四。安装mcrypt

1.下载并解压libmcrypt-2.5.8.tar.bz2

http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download
到命令行解压
cd ~/Downloads
sudo tar -xvf libmcrypt-2.5.8.tar
Copy after login


2.编译

cd ~/Downloads/libmcrypt-2.5.8/
./configure --disable-posix-threads --enable-static
make
sudo make install
Copy after login


3.下载php源码文件(注意选择版本)

查看php版本 
php -v
下载http://cn2.php.net/distributions/php-5.5.14.tar.gz
tar -xvf php-5.5.14.tar
cd php-5.5.14
/usr/bin/phpize
./configure
make
sudo make install
sudo vi /etc/php.ini
加入内容extension=mcrypt.so
sudo apachectl restart
Copy after login


五。安装PhpMyAdmin

1.下载PhpMyAdmin

放置到/Library/WebServer/Documents/phpMyAdmin中。

2.设置

把config.sample.inc.php复制为config.inc.php,做如下修改:

用于Cookie加密,随意的长字符串

$cfg['blowfish_secret']='fewf323';
$cfg['Servers'][$i]['host']='localhost';
$cfg['Servers'][$i]['AllowNoPassword']=false;
Copy after login




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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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

What should I do if wps cannot start the source application of this object? What should I do if wps cannot start the source application of this object? Mar 13, 2024 pm 09:13 PM

WPS is a very widely used office software, including documents, forms and PPT, and supports multi-terminal synchronization. If the prompt "The source application for this object cannot be launched" appears when editing wps, how to solve it? This problem may occur because you are trying to open a link or file, but its source application no longer exists or has been deleted. Here are some fixes: 1. Reinstall WPS software: Try reinstalling WPSOffice to fix the problem and make sure you are using the latest version. 2. Manually change the default program: Try to change the default program to WPS. You can right-click the file you want to open, select "Open with", and then

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:

Which one to choose when starting wallpaperengine? Which one to choose when starting wallpaperengine? Mar 19, 2024 am 08:49 AM

When wallpaperengine starts, there are 4 different options. Many users don't know which one to choose when starting wallpaperengine. Generally, when wallpaperengine starts, choose the first one: start 32-bit. Which one to choose when starting wallpaperengine? Answer: Start 32-bit. 1. Generally, when wallpaperengine starts, select the first one: start 32-bit. 2. When wallpaperengine starts, there are 4 different options: start 32-bit; start 64-bit. 3. Start 32-bit: This is a generally recommended option and suitable for most users. 4. Start 64-bit: If the system supports 64-bit, you can choose this option

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

What are the empty account detection platforms? Empty number detection tool What are the empty account detection platforms? Empty number detection tool Mar 07, 2024 pm 01:46 PM

With the advancement of communication technology, telephone contact has become more and more common in our daily lives. However, sometimes we may try to call a number only to find that the number is no longer reachable. In order to save time and energy, many people start looking for empty number verification services to confirm the validity of the number. This service can help users quickly check whether a number is valid and avoid unnecessary trouble. 1. What are the empty account detection platforms? Users can check the status of the number, including whether it is empty, by dialing the corresponding inquiry number or visiting the official website through the official inquiry service provided by the operator. This service is provided by many operators to facilitate users to quickly understand the usage of the number. Online empty number detection platforms are now emerging in an endless stream on the market. These platforms provide quick and convenient

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

See all articles