Ubuntu LNMP怎么部署WordPress

下面由WordPress教程栏目给大家介绍Ubuntu LNMP怎么部署 WordPress,希望对需要的朋友有所帮助!

软件版本说明:

  • Ubuntu: 16.04 LTS;

  • WordPress: 4.7 zh-CN

适用人群:初级 PHP 入门者和广大想拥有自己站点的设计师

安装 PHP7.1

1.首先添加 PPA

sudo apt-get update sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php -y sudo apt-get update

2.然后,安装 PHP7.1

sudo apt-get -y install php7.1 sudo apt-get -y install php7.1-mysql php7.1-fpm

安装 Mysql

sudo apt-get -y install mysql-server-5.7

设置密码就,OK。

至此,基本的 WordPress 环境就准备完毕了。

部署 WordPress

首先通过 git 拉取 WordPress 源代码:

git clone https://github.com/JellyBool/wordpress.git /var/www/wordpress

配置 Mysql

通过下面的命令来登录 mysql

mysql -u root -p

在 mysql 执行:

CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;  CREATE USER 'jellybool' IDENTIFIED BY 'laravist'; GRANT ALL PRIVILEGES ON wordpress.* TO 'jellybool';  quit

注意上面的 jellyboollaravist是根据你自己的需求来设置的。

配置 Nginx

打开配置文件:

vim /etc/nginx/sites-available/default

进行以下配置配置:

root /var/www/wordpress;  index index.php index.html index.htm index.nginx-debian.html; # 注意我们添加了 index.php  location / {         try_files $uri $uri/ /index.php?$query_string;     } location ~ .php$ {         try_files $uri /index.php =404;         fastcgi_split_path_info ^(.+.php)(/.+)$;         fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;         fastcgi_index index.php;         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;         include fastcgi_params;  }

访问你的域名,就可以进行非常出名的 WordPress 五分钟安装过程啦!安装完毕之后,你就拥有一个 WordPress 的站点啦!

最后

配置 WordPress 文件上传,打开 wp-config.php 文件:

define('FS_METHOD', 'direct'); define('FS_CHMOD_DIR', 0777); define('FS_CHMOD_FILE', 0777);

安装其他的 php 扩展

sudo apt install -y php7.1-gd php7.1-mbstring php7.1-xmlrpc

至此,打完收工。

以上就是Ubuntu LNMP怎么部署WordPress的详细内容,更多请关注七哩云社其它相关文章!

wordpress教程

怎么为WordPress上下篇文章链接添加缩略图

2022-6-13 21:41:52

wordpress教程

找不到wp config.php怎么办

2022-6-13 21:41:56

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
今日签到
有新私信 私信列表
搜索