1、更新yum 源
[[email protected] ~]# yum -y update


2、批量安装软件
[[email protected] ~]# 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版本
[[email protected] ~]# php –version

4.查询之前安装的php包
[[email protected] ~]# rpm –qa | grep php

5.卸载当前的版本
必须强制删除
卸载php相关所有的
[[email protected] ~]# rpm -qa | grep php | xargs rpm –e

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

6、更新php的yum源:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

7、安装新版php环境 5.6版本
#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


8、启动httpd服务:
[[email protected] ~]# service httpd start


9、启动Mysql服务
[[email protected] init.d]# service mysqld start

10.查看端口
[[email protected] init.d]# ss -tnl

11.安装完之后开启MySQL服务:
进入mysql
[[email protected] ~]# mysql

12.配置数据库数据


为WordPress在MySQL中创建一个DB及相关用户
[[email protected] html]# mysql

13.显示数据库
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| test |
±-------------------+
3 rows in set (0.00 sec)

14.创建一个wordpress的数据库
mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)

15.再显示数据库
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| test |
| wordpress |
±-------------------+
4 rows in set (0.00 sec)

16.创建用户[email protected]
mysql> create user [email protected];
Query OK, 0 rows affected (0.00 sec)

17.使用我的数据库
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

18.从User中查询用户
mysql> select User from user;
±-------+
| User |
±-------+
| root |
| |
| root |
| |
| root |
| wpuser |
±-------+
6 rows in set (0.00 sec)

19.把user中叫wpuser的用户的密码更改为wppassword。
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

20.在wordpress里面把所有权限授予给[email protected]
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO [email protected] IDENTIFIED BY ‘wppassword’;
Query OK, 0 rows affected (0.00 sec)

21.刷新权限。
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

22.退出。
mysql> exit;
Bye

#登录MYSQL

[[email protected] html]# service mysqld restart



23.配置WordPress
把wordpress解压后的文件夹放入/var/www/html中

或者 把压缩包放进去
然后 在html中ll 查询出wordpress的压缩包
再解压和安装 [[email protected] html]# tar xvf wordpress-4.5.3-zh_CN.tar.gz
24.进入html中的wordpress的文件夹
[[email protected] html]# cd /var/www/html
[[email protected] html]# cd wordpress/

25.拷贝生成wp-config.php文件
[[email protected] wordpress]# cp wp-config-sample.php wp-config.php

26.配置wp-config.php
[[email protected] wordpress]# vim wp-config.php

修改wp-config.php下面位置的内容,将内容修改为数据库中配置的信息
/** WordPress数据库的名称 */

define(‘DB_NAME’,‘wordpress’);

/** MySQL数据库用户名 */

define(‘DB_USER’,‘wpuser’);

/** MySQL数据库密码 */

define(‘DB_PASSWORD’,‘wppassword’);


27.测试
打开虚拟机中的火狐,输入网址:
http://localhost/wordpress/
http://localhost/wordpress/wp-admin/install.php

wordpress部署wordpress部署
28.关闭防火墙
[[email protected] wordpress]# service iptables stop;

29.访问地址为虚拟机IP + 端口 + /wordpress/ 或者 访问地址为虚拟机域名 + /wordpress/
wordpress部署
8.8.2 修改数据库中访问地址
首先我们登录MySql数据库,查看表”wp_options”的数据(你的表不一定是以”wp”开始的),修改”option_name “为”siteurl”和”home”的两条记录(一般在第一页和第二页),将内容改为之前能够正常使用的地址。保存数据后,就可以重新登录网站和后台了。
mysql> select * from wp_options where option_name = ‘siteurl’ or option_name = ‘home’;
±----------±------------±---------------------------±---------+
| option_id | option_name | option_value | autoload |
±----------±------------±---------------------------±---------+
| 2 | home | http://127.0.0.1/wordpress | yes |
| 1 | siteurl | http://127.0.0.1/wordpress | yes |
±----------±------------±---------------------------±---------+
2 rows in set (0.00 sec)
mysql> update wp_options set option_value=‘http://192.168.138.132/wordpress’ where option_name = ‘siteurl’ or option_name = ‘home’;
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0

相关文章:

  • 2022-12-23
  • 2022-03-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-06-22
  • 2021-06-23
  • 2022-12-23
猜你喜欢
  • 2021-11-04
  • 2021-05-13
  • 2021-11-30
  • 2021-07-10
  • 2021-12-07
  • 2022-01-31
相关资源
相似解决方案