①.更新yum 源
[root@bogon ~]# yum -y update
②.安装软件
yum install httpd mysql-server php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc -y
③.查看php版本命令:如果低于5.6则卸载:
#php -v
//卸载php相关所有的版本
rpm -qa | grep php | xargs rpm -e
④.再次查看是否完全删除
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
⑦.启动httpd服务:
[root@Shining ~]# service httpd start
⑧.启动Mysql服务
[root@localhost init.d]# service mysqld start
⑨.查看端口
ss -tnl
安装完之后开启MySQL服务:
进入mysql
配置数据库数据
为WordPress在MySQL中创建一个DB及相关用户
#登录MYSQL
⑩进入mysql数据库
[root@bogon html]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
①①.查看所有数据库
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| test |
±-------------------+
3 rows in set (0.00 sec)
①②.创建一个名叫wordpress的数据库
mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)
①③.再次查看wordpress数据库是否创建成功
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数据库
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
①⑥.查看user表中User属性
mysql> select User from user;
±-------+
| User |
±-------+
| root |
| |
| root |
| |
| root |
| wpuser |
±-------+
6 rows in set (0.00 sec)
①⑦.更新user表中存储的用户名和密码
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
①⑧.授权wpuser用户拥有wordpress.* TO的所有权限。
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wpuser@localhost IDENTIFIED BY ‘wppassword’;
Query OK, 0 rows affected (0.00 sec)
①⑨.刷新mysql的系统权限相关表
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
②〇.退出mysql
mysql> exit;
Bye
②①.先把wordpress压缩包拉到/,home,自己名称,下载里面
再进入虚拟机打开终端,进入超级管理模式
①# su
②以root权限打开窗口管理文件#sudo nautilus
③将下载中wordoress文件复制到home/var/www/html
④右键解压
②②.配置WordPress
…进入html文件夹
[root@bogon html]# cd /var/www/html
…进入wordpress文件
[root@bogon html]# cd wordpress/
…创建wp-config-sample.php wp-config.php
[root@bogon wordpress]# cp wp-config-sample.php wp-config.php
…编辑wp-config.php
[root@bogon wordpress]# vim wp-config.php
[root@bogon wordpress]#
②⑤修改wordpress数据库名称、用户名、密码
/** WordPress数据库的名称 */
define(‘DB_NAME’,‘wordpress’);
/** MySQL数据库用户名 */
define(‘DB_USER’,‘wpuser’);
/** MySQL数据库密码 */
define(‘DB_PASSWORD’,‘wppassword’);