其他分享
首页 > 其他分享> > settings 贵阳昆明

settings 贵阳昆明

作者:互联网

Mac 设备WordPress
一、环境要求
PHP 5.2.4或更新版别
MySQL 5.0或更新版别
WebServer(能够挑选Apache、nginx等支撑PHP的,这儿我挑选Apache)
二、软件设备
1、设备PHP
Mac OSX 自带PHP,无需设备。
不主张通过brew、源码设备等办法晋级PHP7。若需求可在虚拟机中检验。
2、设备MySQL
MySQL下载
访问MySQL的官网 http://www.mysql.com/downloads/ 在页面中会看到“MySQL Community Server”下方有一个“download”按钮,点击该按钮。
进入MySQL的下载界面 http://www.mysql.com/downloads/mysql/,下面罗列的都是在Mac OS上能用的MySQL的版别,挑选需求的版别点击下载。
然后会跳转到其他一个界面,这个界面是提示你需不需求注册的,直接挑选最下面的“No thanks,just take me to downloads!”,然后这才实在跳转到了下载的界面,这个界面列了许多的供下载的服务器,挑选一个服务器进行下载就OK了。
MySQL设备
双击下载下来的文件,一般里边会有几个文件,5.6以上的包里边没有MySQL.prefPane文件,可是会默许设备;5.6以下则需求自己手动设备。
设备完结后,会在体系的(偏好设置)里边出现MySQL的办理按钮,通过这个按钮能够主张和间断MySQL。
⚠️留心:MySQL设备完结时,会以弹窗的办法闪现初始暗码,请保存好该暗码!!!
MySQL装备
翻开命令行
vi .bash_profile
tcsh下增加如下内容:
alias mysql /usr/local/mysql/bin/mysql
alias mysqladmin /usr/local/mysql/bin/mysqladmin
bash下增加如下内容:
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
保存并退出,并启用装备
1
source .bash_profile
初度运用MySQL时需求修改暗码,表现为以下过失
1
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
详细能够参照官网的比如处理
http://dev.mysql.com/doc/refman/5.7/en/alter-user.html
http://dev.mysql.com/doc/refman/5.6/en/alter-user.html
以下为我的处理方案
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;
现在就能够运用新暗码从头登录数据库
创建数据库
1
mysql>create database  database-name;
2、设备Apache
Mac OSX 自带Apache,无需设备。
Apache装备
根目录装备文件为/etc/apache2/httpd.conf
sudo vi /etc/apache2/httpd.conf
查找DocumentRoot(操作按ESC + shift + :+ /DocumentRoot)
修改为如下内容即可
# 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/"
为什么把Apache的网站根目录放在/usr/local/www/这儿?
答:不需求修改权限,不需求折腾。
把这行的注释去掉
#LoadModule php5_module libexec/apache2/libphp5.so
多站点装备文件为/etc/apache2/extra/httpd-vhosts.conf
#
#    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
#
里边有2个比如,拷贝一个修改如下
    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
    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
现在apache多站点装备好了。
修改/etc/hosts文件
sudo vi /etc/hosts
修改如下内容,
##
# 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
现在能够通过在浏览器中输入:localhost/WordPress01 访问 WordPress01 的内容了
重启Apache:
sudo apachectl restart
间断Apache:
sudo apachectl stop
三、设备WordPress
到WordPress的官网
https://cn.wordpress.org/
上下载设备包,解压侧重命名为WordPress01,放到/usr/local/www/WordPress目录下面。
修改WordPress01里边的wp-config-example.conf的内容如下侧重命名为wp-config.conf
 * WordPress根底装备文件。
 *
 * 这个文件被设备程序用于自动生成wp-config.php装备文件,
 * 您能够不运用网站,您需求手动拷贝这个文件,
 * 侧重命名为“wp-config.php”,然后填入相关信息。
 *
 * 本文件包含以下装备选项:
 *
 * * MySQL设置
 * * 密钥
 * * 数据库表名前缀
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/zh-cn:%E7%BC%96%E8%BE%91_wp-config.php
 *
 * @package WordPress
 */
// ** MySQL 设置 - 详细信息来自您正在运用的主机 ** //
/** WordPress数据库的称号 */
define('DB_NAME', 'WordPress');
/** MySQL数据库用户名 */
define('DB_USER', 'root');
/** MySQL数据库暗码 */
define('DB_PASSWORD', '123456');
/** MySQL主机 */
define('DB_HOST', 'localhost');
/** 创建数据表时默许的文字编码 */
define('DB_CHARSET', 'utf8');
/** 数据库拾掇类型。如不确定请勿更改 */
define('DB_COLLATE', '');
/**#@+
 * 身份认证密钥与盐。
 *
 * 修改为任意绝无仅有的字串!
 * 或许直接访问{@link https://api.wordpress.org/secret-key/1.1/salt/
 * WordPress.org密钥生成服务}
 * 任何修改都会导致悉数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数据表前缀。
 *
 * 假设您有在同一数据库内设备多个WordPress的需求,请为每个WordPress设置
 * 不同的数据表前缀。前缀名只能为数字、字母加下划线。
 */
$table_prefix  = 'wp_';
/**
 * 开发者专用:WordPress调试形式。
 *
 * 将这个值改为true,WordPress将闪现悉数用于开发的提示。
 * 剧烈主张插件开发者在开发环境中启用WP_DEBUG。
 *
 * 要获取其他能用于调试的信息,请访问Codex。
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define('WP_DEBUG', true);
/**
 * zh_CN本地化设置:启用ICP备案号闪现
 *
 * 可在设置→常规中修改。
 * 如需禁用,请移除或注释掉本行。
 */
define('WP_ZH_CN_ICP_NUM', true);
/* 好了!请不要再持续修正。请保存本文件。运用愉快! */
/** WordPress目录的绝对路径。 */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');
/** 设置WordPress变量和包含文件。 */
require_once(ABSPATH . 'wp-settings.php');
现在能够通过在浏览器中输入:localhost/WordPress01 设备WordPress了。
⚠️留心:这儿很有或许会在浏览器中看到“链接数据库产生过失”,需求承认以下内容:
* 数据库用户名和暗码正确。
* 数据库现已主张并能访问。
假设以上无误,请修改wp-config.conf文件中的
/** MySQL主机 */
define('DB_HOST', 'localhost');
改为:
/** MySQL主机 */
define('DB_HOST', '127.0.0.1');
或许是 MySQL主机的IP
接下来正常设备即可。

标签:log,settings,mysql,贵阳,WordPress,usr,MySQL,昆明,define
来源: https://www.cnblogs.com/cqdyfwgs/p/15707844.html