部署wordpress到虚拟机
#安装软件
yum install httpd mysql-server php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc -y
查看php版本
php -version
如果低于5.6则卸载:
//卸载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
进入mysql
[root@Shining ~]# mysql
为WordPress在MySQL中创建一个DB及相关用户
mysql> show databases;
mysql> create database wordpress;
mysql> create user wpuser@localhost;
mysql> use mysql;
mysql> select User from 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
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
//配置WordPress
将该压缩包拷贝到/var/www/html目录,并且解压到该目录,注意压缩包的名称
cp wordpress-4.5.3-zh_CN.tar.gz /var/www/html
[root@bogon html]# tar xvf wordpress5.xxx.gz
[root@bogon html]# cd /var/www/html
[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’);