ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

搭建LAMP环境,并搭建wordpress

2021-05-27 10:57:53  阅读:132  来源: 互联网

标签:LAMP html wordpress mysql php root localhost 搭建


本文参考这边博文,不过有坑,所以已经给出解决方案了:https://www.freesion.com/article/199793312/

[root@localhost ~]# yum install httpd

搭建LAMP环境,并搭建wordpress

查看本机地址:
搭建LAMP环境,并搭建wordpress

通过浏览器访问地址:

搭建LAMP环境,并搭建wordpress

通过rpm源安装mysql

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

yum install mysql mysql-server mysql-libs mysql-server

如图:

搭建LAMP环境,并搭建wordpress

搭建LAMP环境,并搭建wordpress

搭建LAMP环境,并搭建wordpress

搭建LAMP环境,并搭建wordpress

1.关闭Mysql服务

systemctl stop mysqld.service

2.修改配置文件无密码登录

vi /etc/my.cnf
最后加上

skip-grant-tables
3.启动Mysql

systemctl start mysqld.service
4.登陆Mysql

mysql -u root

搭建LAMP环境,并搭建wordpress

5.修改密码

搭建LAMP环境,并搭建wordpress

6.再次打开my.cnf 把那最后那句刚添加的skip-grant-tables再删掉

7.重启Mysql

systemctl restart mysqld.service

在 MYSQL 中新建数据库

create database wordpress;

Query OK, 1 row affected (0.00 sec)//出现这句话说明创建成功

安装PHP以及相关组件 :

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

测试PHP是否安装成功
在/var/www/html下建立一个test.php文件:

文件内输入
<?php
phpinfo();
?>

[root@localhost ~]# systemctl restart httpd.service

搭建LAMP环境,并搭建wordpress

接下来,下载wordpress:
https://cn.wordpress.org/download/releases/

我下载的版本:
搭建LAMP环境,并搭建wordpress

传到linux服务器上

搭建LAMP环境,并搭建wordpress

yum install unzip

unzip wordpress-4.9.4-zh_CN.zip

[root@localhost ~]# cp -r wordpress/* /var/www/html/

[root@localhost ~]# cd /var/www/html/

[root@localhost html]# cp wp-config-sample.php wp-config.php

编辑wordpress的配置文件

vi wp-config.php

搭建LAMP环境,并搭建wordpress

再次打开浏览器,输入IP,即可看到Wordpress配置安装界面,然后安装成功,可以正常使用了。

===================================

问题:

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

ALTER USER 'root'@'localhost' IDENTIFIED BY 'wordpress2018' PASSWORD EXPIRE NEVER;
之后使用以下指令刷新权限:

flush privileges;

标签:LAMP,html,wordpress,mysql,php,root,localhost,搭建
来源: https://blog.51cto.com/u_13869972/2820829

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有