zoukankan      html  css  js  c++  java
  • Wordpress安装-报错说明

    一:下载WordPress安装包并解压

    下载地址:https://wordpress.org/latest.tar.gz

    • 如果使用FTP将wordpress上传到远程服务器,先下载压缩包,之后上传
    • 如果使用shell访问远程服务器,直接在远程服务器上使用wget工具下载(Linux系统)
      • wget https://wordpress.org/latest.tar.gz
      • 解压缩:tar -xzvf latest.tar.gz

    二:创建Wordpress数据库和用户

    [root@vps]# mysql -uroot -p
    Welcome to the MariaDB monitor.  Commands end with ; or g.
    Your MariaDB connection id is 10
    Server version: 10.3.21-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    MariaDB [(none)]> drop database wordpress;
    Query OK, 12 rows affected (0.300 sec)
    
    MariaDB [(none)]> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    +--------------------+
    3 rows in set (0.000 sec)
    
    
    MariaDB [(none)]> create database wordpress;
    Query OK, 1 row affected (0.000 sec)
    
    MariaDB [(none)]> grant all privileges on wordpress.* to "username"@'hostname' identified by 'password';
    Query OK, 0 rows affected (0.001 sec)
    
    MariaDB [(none)]> flush privileges;
    Query OK, 0 rows affected (0.000 sec)
    
    MariaDB [(none)]> exit
    Bye
    

    三:设置wp-config.php文件

    可以在运行安装脚本的时候让wordpress自行设置wp-config.php文件;也可以手动设置wp-config.php文件

    1. wp-config-sample.php重命名为wp-config.php

    2. 编辑wp-config.php文件

      // ** MySQL settings - You can get this info from your web host ** //
      /** The name of the database for WordPress */
      define( 'DB_NAME', 'database_name_here' );		# 为创建worpress的数据库名称
      
      /** MySQL database username */
      define( 'DB_USER', 'username_here' );			# 为创建的wrdpress用户名
      
      /** MySQL database password */
      define( 'DB_PASSWORD', 'password_here' );		# 为创建的wordpress用户名的密码
      
      /** MySQL hostname */
      define( 'DB_HOST', 'localhost' );				# 为设置的hostname
      
      /** Database Charset to use in creating database tables. */
      define( 'DB_CHARSET', 'utf8' );
      
      /** The Database Collate type. Don't change this if in doubt. */
      define( 'DB_COLLATE', '' );
      
      

    四:设置文件在网站的位置

    • 使用的是nginx的话,默认文件位置为:/usr/share/nginx/html

    • 也可以自定义文件位置,需要修改nginx的网页配置文件,下面是我的wordpress网页配置文件

      [root@vps]# cat /etc/nginx/conf.d/alongway.top.conf
      server {
          listen       80; 
          server_name  alongway.top www.alongway.top;
      
          location / {
              root   /data/www/wordpress;
              index  index.php index.html index.htm;
          }
      
          error_page 500 502 503 504 403 404 /404.html;
          location = /404.html {
              root /data/www/blog;
          }
          
          location ~ .php$ {
              root           html;
              fastcgi_pass   127.0.0.1:9000;
              fastcgi_index  index.php;
              fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
              include        fastcgi_params;
          }
      
      }
      

    五:运行安装脚本

    在web浏览器中与运行安装脚本

    已经设置了网站根目录,并且已经把Wordpress文件放置到了网站根目录下,所以访问:

    http://www.alongway.top/wp-admin/install.php

    至此,安装完成

    解决安装主题插件,更新需要FTP

    在wordpress网站目录下的wp-config.php文件添加如下内容

    vim wp-config.php
    define('FS_METHOD','direct');
    define('FS_CHMOD_DIR',0777);
    define('FS)CHMOD_FILE',0777);
    
  • 相关阅读:
    ASP.NET Core 2.2 基础知识(二) 中间件
    ASP.NET Core 2.2 基础知识(一) 依赖注入
    初识.NET Core
    volatile 和 Interlocked
    线程池
    MySQL 将某个字段值的记录排在最后,其余记录单独排序
    MySQL 一张表中两个字段值互换
    (转) C#解惑:HashSet<T>类
    利用 ildasm 修改被编译后DLL文件
    shell 字符串判断
  • 原文地址:https://www.cnblogs.com/moniter/p/12630125.html
Copyright © 2011-2022 走看看