亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Table of Contents
1. Environment requirements
2. Software installation
1. Install PHP
2. Install MySQL
MySQL download
MySQL installation
MySQL configuration
Create database
2. Install Apache
Apache configuration
3. Install WordPress
Home CMS Tutorial WordPress One article explains how to install WordPress on Mac

One article explains how to install WordPress on Mac

Dec 17, 2021 pm 02:59 PM
mac wordpress

The following tutorial column of WordPress will introduce to you how to install WordPress on Mac. I hope it will be helpful to friends in need!

Mac installation WordPress

1. Environment requirements

  • PHP 5.2.4 or newer version

  • MySQL 5.0 or newer version

  • WebServer (you can choose Apache, nginx, etc. that support PHP, here I choose Apache)

2. Software installation

1. Install PHP

Mac OSX comes with PHP, no need to install it.

It is not recommended to upgrade PHP7 through brew, source code installation, etc. Test in a virtual machine if necessary.

2. Install MySQL

MySQL download

Visit MySQL’s official website http://www.mysql.com/downloads/ You will see “MySQL Community Server” on the page "There is a "download" button below, click the button.

Enter the MySQL download interface http://www.mysql.com/downloads/mysql/. Listed below are the versions of MySQL that can be used on Mac OS. Select the required version and click to download.

Then it will jump to another interface. This interface prompts you whether you need to register or not. Just select "No thanks, just take me to downloads!" at the bottom, and then this will actually jump to it. Download interface, this interface lists many servers for downloading, just select a server to download.

MySQL installation

Double-click the downloaded file. Generally, there will be several files in it. There is no MySQL.prefPane file in the package above 5.6, but it will be installed by default; below 5.6, you need to manually Install.
After the installation is completed, the MySQL management button will appear in the system (Preferences), through which you can start and stop MySQL.

??Note: When the MySQL installation is completed, the initial password will be displayed in a pop-up window, please save the password! ! !

MySQL configuration

Open the command line
Edit .bash_profile and add the following content

vi?.bash_profile??
tcsh下添加如下內(nèi)容:
alias?mysql?/usr/local/mysql/bin/mysql
alias?mysqladmin?/usr/local/mysql/bin/mysqladmin
bash下添加如下內(nèi)容:
alias?mysql=/usr/local/mysql/bin/mysql
alias?mysqladmin=/usr/local/mysql/bin/mysqladmin

Save and exit, and enable the configuration

source?.bash_profile

First time When using MySQL, you need to change the password, which is manifested as the following error

ERROR?1820?(HY000):?You?must?reset?your?password?using?ALTER?USER?statement?before?executing?this?statement.

Please refer to the official website for examples
http://dev.mysql.com/doc/refman/5.7/en/alter-user. html
http://dev.mysql.com/doc/refman/5.6/en/alter-user.html

The following is my solution

mysql>?SELECT?1;
ERROR?1820?(HY000):?You?must?SET?PASSWORD?before?executing?this?statement

mysql>?SET?PASSWORD?=?PASSWORD('new_password');
Query?OK,?0?rows?affected?(0.01?sec)??
??
mysql>?quit;

You can use it now Log in to the database again with a new password

Create database
mysql>create?database??database-name;

2. Install Apache

Mac OSX comes with Apache, no need to install it.

Apache configuration

The root directory configuration file is/etc/apache2/httpd.conf

sudo?vi?/etc/apache2/httpd.conf

搜索DocumentRoot(操作按ESC?+?shift?+?:+?/DocumentRoot)

修改為如下內(nèi)容即可
#?DocumentRoot:?The?directory?out?of?which?you?will?serve?your
#?documents.?By?default,?all?requests?are?taken?from?this?directory,?but
#?symbolic?links?and?aliases?may?be?used?to?point?to?other?locations.
DocumentRoot?"/usr/local/www/"
<Directory "/usr/local/www/">

為什么把Apache的網(wǎng)站根目錄放在/usr/local/www/這里???
答:不需要修改權(quán)限,不需要折騰。

把這行的注釋去掉
#LoadModule?php5_module?libexec/apache2/libphp5.so

The multi-site configuration file is/etc/apache2/extra/httpd-vhosts. conf

#<VirtualHost *:80>
#????ServerAdmin?webmaster@dummy-host2.example.com
#????DocumentRoot?"/usr/docs/dummy-host2.example.com"
#????ServerName?dummy-host2.example.com
#????ErrorLog?"/private/var/log/apache2/dummy-host2.example.com-error_log"
#????CustomLog?"/private/var/log/apache2/dummy-host2.example.com-access_log"?common
#</VirtualHost>

里面有2個例子,復(fù)制一個修改如下
<VirtualHost *:80>
????DocumentRoot?"/usr/local/www/WordPress/WordPress01"
????ServerName?WordPress01
????ErrorLog?"/private/var/log/apache2/WordPress01-error_log"
????CustomLog?"/private/var/log/apache2/WordPress01-access_log"?common
</VirtualHost>

<VirtualHost *:80>
????DocumentRoot?"/usr/local/www/WordPress/WordPress02"
????ServerName?WordPress02
????ErrorLog?"/private/var/log/apache2/WordPress02-error_log"
????CustomLog?"/private/var/log/apache2/WordPress02-access_log"?common
</VirtualHost>

現(xiàn)在apache多站點配置好了。

Modify the /etc/hosts file

sudo?vi?/etc/hosts
修改如下內(nèi)容,

##
#?Host?Database
#
#?localhost?is?used?to?configure?the?loopback?interface
#?when?the?system?is?booting.??Do?not?change?this?entry.
##
127.0.0.1????????localhost
255.255.255.255??broadcasthost
127.0.0.1????????WordPress01
127.0.0.1????????WordPress02
127.0.0.1????????phpMyAdmin
::1??????????????localhost

啟動Apache:
sudo?apachectl?start

現(xiàn)在可以通過在瀏覽器中輸入:localhost/WordPress01?訪問?WordPress01?的內(nèi)容了

重啟Apache:
sudo?apachectl?restart

停止Apache:
sudo?apachectl?stop

3. Install WordPress

Go to the WordPress official website
https://cn.wordpress.org/
Download the installation package, unzip it and rename it to WordPress01, and put it under the /usr/local/www/WordPress directory.
Modify the content of wp-config-example.conf in WordPress01 as follows and rename it to wp-config.conf

<?php
/**
?*?WordPress基礎(chǔ)配置文件。
?*
?*?這個文件被安裝程序用于自動生成wp-config.php配置文件,
?*?您可以不使用網(wǎng)站,您需要手動復(fù)制這個文件,
?*?并重命名為“wp-config.php”,然后填入相關(guān)信息。
?*
?*?本文件包含以下配置選項:
?*
?*?*?MySQL設(shè)置
?*?*?密鑰
?*?*?數(shù)據(jù)庫表名前綴
?*?*?ABSPATH
?*
?*?@link?https://codex.wordpress.org/zh-cn:%E7%BC%96%E8%BE%91_wp-config.php
?*
?*?@package?WordPress
?*/

//?**?MySQL?設(shè)置?-?具體信息來自您正在使用的主機?**?//
/**?WordPress數(shù)據(jù)庫的名稱?*/
define('DB_NAME',?'WordPress');

/**?MySQL數(shù)據(jù)庫用戶名?*/
define('DB_USER',?'root');

/**?MySQL數(shù)據(jù)庫密碼?*/
define('DB_PASSWORD',?'123456');

/**?MySQL主機?*/
define('DB_HOST',?'localhost');

/**?創(chuàng)建數(shù)據(jù)表時默認(rèn)的文字編碼?*/
define('DB_CHARSET',?'utf8');

/**?數(shù)據(jù)庫整理類型。如不確定請勿更改?*/
define('DB_COLLATE',?'');

/**#@+
?*?身份認(rèn)證密鑰與鹽。
?*
?*?修改為任意獨一無二的字串!
?*?或者直接訪問{@link?https://api.wordpress.org/secret-key/1.1/salt/
?*?WordPress.org密鑰生成服務(wù)}
?*?任何修改都會導(dǎo)致所有cookies失效,所有用戶將必須重新登錄。
?*
?*?@since?2.6.0
?*/
define('AUTH_KEY',????????????'put?your?unique?phrase?here');
define('SECURE_AUTH_KEY',?????'put?your?unique?phrase?here');
define('LOGGED_IN_KEY',???????'put?your?unique?phrase?here');
define('NONCE_KEY',???????????'put?your?unique?phrase?here');
define('AUTH_SALT',???????????'put?your?unique?phrase?here');
define('SECURE_AUTH_SALT',????'put?your?unique?phrase?here');
define('LOGGED_IN_SALT',??????'put?your?unique?phrase?here');
define('NONCE_SALT',??????????'put?your?unique?phrase?here');

/**#@-*/

/**
?*?WordPress數(shù)據(jù)表前綴。
?*
?*?如果您有在同一數(shù)據(jù)庫內(nèi)安裝多個WordPress的需求,請為每個WordPress設(shè)置
?*?不同的數(shù)據(jù)表前綴。前綴名只能為數(shù)字、字母加下劃線。
?*/
$table_prefix??=?'wp_';

/**
?*?開發(fā)者專用:WordPress調(diào)試模式。
?*
?*?將這個值改為true,WordPress將顯示所有用于開發(fā)的提示。
?*?強烈建議插件開發(fā)者在開發(fā)環(huán)境中啟用WP_DEBUG。
?*
?*?要獲取其他能用于調(diào)試的信息,請訪問Codex。
?*
?*?@link?https://codex.wordpress.org/Debugging_in_WordPress
?*/
define('WP_DEBUG',?true);

/**
?*?zh_CN本地化設(shè)置:啟用ICP備案號顯示
?*
?*?可在設(shè)置→常規(guī)中修改。
?*?如需禁用,請移除或注釋掉本行。
?*/
define('WP_ZH_CN_ICP_NUM',?true);

/*?好了!請不要再繼續(xù)編輯。請保存本文件。使用愉快!?*/

/**?WordPress目錄的絕對路徑。?*/
if?(?!defined('ABSPATH')?)
????define('ABSPATH',?dirname(__FILE__)?.?'/');

/**?設(shè)置WordPress變量和包含文件。?*/
require_once(ABSPATH?.?'wp-settings.php');

現(xiàn)在可以通過在瀏覽器中輸入:localhost/WordPress01?安裝WordPress了。

??注意:這里很有可能會在瀏覽器中看到“鏈接數(shù)據(jù)庫發(fā)生錯誤”,需要確認(rèn)以下內(nèi)容:

*?數(shù)據(jù)庫用戶名和密碼正確。
*?數(shù)據(jù)庫已經(jīng)啟動并能訪問。

如果以上無誤,請修改wp-config.conf文件中的??
/**?MySQL主機?*/
define('DB_HOST',?'localhost');

改為:
/**?MySQL主機?*/
define('DB_HOST',?'127.0.0.1');

或者是?MySQL主機的IP

接下來正常安裝即可。

The above is the detailed content of One article explains how to install WordPress on Mac. For more information, please follow other related articles on the PHP Chinese website!

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

Undress AI Tool

Undress AI Tool

Undress images for free

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.

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)

Hot Topics

PHP Tutorial
1488
72
How to use an iPad as a second display for Mac How to use an iPad as a second display for Mac Jul 03, 2025 am 01:01 AM

To use the iPad as a Mac sub-screen, you can use the Sidecar function. The steps are as follows: First, make sure the device meets the requirements (Mac will run macOSCatalina and above after 2016, and iPad requires iPadOS13 or above); then go to "System Settings" > "Display" on the Mac, click "Add Monitor" and select iPad to connect; if it is unable to connect, you need to check whether Wi-Fi and Bluetooth are on, and make sure the two devices are in the same network environment. In terms of connection mode, wireless is suitable for daily office work but may have delays, while wired is more stable and supports charging. The display mode is divided into two types: extension and mirroring. It is recommended to use extension mode to improve work efficiency. In addition, it can also be achieved through preferences

How to set up file sharing between two Macs on the same network? How to set up file sharing between two Macs on the same network? Jul 14, 2025 am 12:08 AM

To share files between two Macs on the same network, first make sure that the two devices are connected to the same LAN, then enable file sharing on the host, set shared folders and access permissions, and then connect from another Mac through the access sidebar or manually enter the SMB address, and finally you can browse, copy or transfer files. Common problems include waiting or restarting the network when the device cannot be discovered. If the permissions are incorrect, you need to check the username, password and sharing settings. If the connection fails, you can try the SMB address. If the firewall blocks, you can temporarily close the test.

How to find large files on my Mac? How to find large files on my Mac? Jul 01, 2025 am 12:06 AM

To free up Mac storage space, you can use three methods to find and process large files: 1. Use the system's own storage management tool to view the "big file" list in "About Native" - ??"Storage"; 2. Set file size and modification time in Finder to search for large files; 3. Use third-party tools such as DaisyDisk, OmniDiskSweeper or GrandPerspective to scan and visualize disk usage. Each method has its own advantages, the system tools are convenient and fast, Finder provides more accurate search options, and third-party software provides stronger analysis functions. Remember to clear the wastebasket after deleting it to avoid remaining space.

How to use a Windows keyboard on a Mac How to use a Windows keyboard on a Mac Jul 08, 2025 am 12:12 AM

When typing on a Mac using a Windows keyboard, the Win key corresponds to the Command key and the Alt key corresponds to the Option key; 1. Understand the key mapping: The Win key replaces the Command key for commonly used shortcut keys such as Command C/V, the Alt key replaces the Option key for special symbol input, and the right Alt key may be mapped to Control or other functions; 2. Adjust the keyboard mapping can be customized through system settings or third-party tool Karabiner-Elements; 3. In terms of function keys and multimedia key support, the F key needs to be used with the Fn key, the default brightness and volume function can be adjusted, and some brand shortcut keys are incompatible and need to be customized; 4. Common shortcut key comparison includes copy and paste.

Why is my Bluetooth mouse lagging or stuttering on my Mac? Why is my Bluetooth mouse lagging or stuttering on my Mac? Jul 03, 2025 am 12:11 AM

Latency or lag on a Bluetooth mouse on a Mac is usually caused by a variety of factors, including wireless interference, low battery, system problems, or multi-device connection overload. 1. Wireless device interference: Keep Mac and mouse away from interference sources such as routers, USB3.0 devices, or switch Wi-Fi to 5GHz band. 2. Mouse battery level is insufficient: Check the battery status and replace the battery through the system settings or the mouse’s own indicator light. 3. The system or Bluetooth driver is not updated: Go to system settings to update macOS and try to reset the Bluetooth module through the debug menu. 4. Too many Bluetooth devices: disconnect unused peripherals, or use a Bluetooth USB adapter to share the load. Gradually checking the above problems can effectively solve the phenomenon of mouse lag.

How to take a screenshot of a specific area on a Mac? How to take a screenshot of a specific area on a Mac? Jun 29, 2025 am 12:31 AM

To capture a specific area on your Mac, you can use the system shortcut key Shift Command 4 to enter the area screenshot mode, drag and select the area and release it to save to the desktop; if you need more options, press Shift Command 5 to open the screenshot tool, click "CaptureSelectedPortion" to take the area screenshot, and set the saving path and display the mouse pointer; a thumbnail will appear in the lower right corner after the screenshot, click to edit and mark it, and save it after completion.

What is Migration Assistant on Mac? What is Migration Assistant on Mac? Jun 29, 2025 am 12:57 AM

MigrationAssistantonMacisabuilt-intoolusedtotransferfiles,accounts,apps,andsettingsfromanoldMac,PC,oranotheruseraccount.1.IthelpssetupanewMacquicklywithoutmanualcopyingorreconfiguration.2.Commonusesincludesettingupanewdevice,recoveringdataafteraclean

How to fix a non-working USB port on a Mac? How to fix a non-working USB port on a Mac? Jul 09, 2025 am 12:36 AM

When the Mac's USB port cannot work, you can try the following methods to troubleshoot problems in turn: 1. Check the connection problem, confirm that the cable and equipment are normal, and clean the interface; 2. Restart the system and check the USB device status in the system report; 3. Reset the SMC and NVRAM (PRAM) to solve potential system abnormalities; 4. Check the system permission settings and device compatibility; 5. Check the hardware damage. If the interface does not respond or the appearance is damaged, professional repairs may be required. In most cases, it can be solved by cleaning, restarting or system adjustment. If it is invalid, hardware failure will be considered.

See all articles