centos7之安装wordpress
wordpress安装教程如下: mysql安装可以参考我的博客园Centos构建Java环境:https://www.cnblogs.com/youcong/p/9118753.html 1.安装apache systemctl start httpd 2.安装php yum install -y php php-mysql vim /var/www/html/info.php <?php phpinfo(); ?>
vim /etc/httpd/conf.d/phpMyAdmin.conf 配置文件内容如下: <Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 IfModule mod_authz_core.c> # Apache 2.4 RequireAny # Require ip 127.0.0.1 # Require ip ::1 Require all granted </> IfModule!mod_authz_core.c # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 > Directory> /usr/share/phpMyAdmin/setup/> Require ip 127.0.0.1 Require ip ::1 > </Directory> 重启httpd服务器 安装完phpmyadmin一定要输入对应的地址进入phpMyAdmin管理平台
进入该平台进行用户添加和数据添加
也可以通过命令行的形式:
例如:
# 登录数据库
mysql -u root -p
# 创建数据库
CREATE DATABASE wordpress;
# 创建数据库用户和密码
CREATE USER wordpressuser@localhost IDENTIFIED BY '123456';
# 设置wordpressuser访问wordpress数据库权限
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY '123456';
# 刷新数据库设置
FLUSH PRIVILEGES;
# 退出数据库
exit
4.安装wordpress 解压后并在当前目录下执行:sudo rsync -avP ~/wordpress/ /var/www/html/wordpress/ 默认内容如下:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME','database_name_here');
/** MySQL database username */
define('DB_USER','username_here');
/** MySQL database password */
define('DB_PASSWORD','password_here');
/** MySQL hostname */
define('DB_HOST','localhost');
将其修改为:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME','wordpress');
/** MySQL database username */
define('DB_USER','wordpress');
/** MySQL database password */
define('DB_PASSWORD','123456');
/** MySQL hostname */
define('DB_HOST','localhost');
完成后在浏览器输入地址:www.example.com/wordpress/wp-admin/install.php (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |