wordpress部署

最后都变了- 提交于 2020-02-08 09:16:57

1、更新yum 源
[root@bogon ~]# yum -y update


2、安装软件

yum install httpd mysql-server php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc -y



3、查看php版本

php -version

如果低于5.6则卸载:
查询php相关包信息

rpm -qa|grep php

提示如下
#php-pdo-5.1.6-27.el5_5.3
#php-mysql-5.1.6-27.el5_5.3
#php-xml-5.1.6-27.el5_5.3
#php-cli-5.1.6-27.el5_5.3
#php-common-5.1.6-27.el5_5.3
#php-gd-5.1.6-27.el5_5.3

//卸载php相关所有的

rpm -qa | grep php | xargs rpm -e

//https://www.inqingdao.cn/737.html

再用# php -v
查看版本信息已经没有提示

更新php的yum源:

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

安装新版php环境

yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-odbc.x86_64 php56w-xml.x86_64 php56w-xmlrpc.x86_64 php56w-soap.x86_64



4、启动httpd服务:

[root@Shining ~]# service httpd start

5、启动Mysql服务

[root@localhost init.d]# service mysqld start

查看端口 ss -tnl
安装完之后开启MySQL服务:
进入mysql

[root@Shining ~]# mysql

配置数据库数据

mysql> show databases;

±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| test |
±-------------------+
3 rows in set (0.00 sec)

mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| test |
| wordpress |
±-------------------+
4 rows in set (0.00 sec)

mysql> create user wpuser@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select User from user;
±-------+
| User |
±-------+
| root |
| |
| root |
| |
| root |
| wpuser |
±-------+
6 rows in set (0.00 sec)

mysql> update user set password = password(“wppassword”) where User = ‘wpuser’;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> GRANT ALL PRIVILEGES ON wordpress. TO wpuser@localhost IDENTIFIED BY ‘wppassword’;*
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit;
Bye



6.配置WordPress
上传WordPress的压缩包到/var/www/html。
第一步:进入/home/RZ 命令: cd /home/RZ
第二步:上传WordPress的压缩包
第三步:移动WordPress的压缩包到/var/www/html 命令:
cp wordpress-4.5.3-zh_CN.tar.gz /var/www/html
第四步:进入 var/www/html 命令:cd /var/www/html

将该压缩包拷贝到/var/www/html目录,并且解压到该目录,注意压缩包的名称
解压命令[root@bogon html]# tar xvf wordpress-4.5.3-zh_CN.tar.gz

[root@bogon html]# cd wordpress/
[root@bogon wordpress]# cp wp-config-sample.php wp-config.php
[root@bogon wordpress]# vim wp-config.php
[root@bogon wordpress]#

/** WordPress数据库的名称 */

define(‘DB_NAME’,‘wordpress’);
/** MySQL数据库用户名 */

define(‘DB_USER’,‘wpuser’);
/** MySQL数据库密码 */

define(‘DB_PASSWORD’,‘wppassword’);

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!