WordPress 如何隐藏wp-config.php里面数据库信息

tetepay  (UID: 2470) [复制链接]
帖子链接已复制到剪贴板
帖子已经有人评论啦,不支持删除!

2086 2

如题

/** Use MySQL over SSL */
define( 'MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL );
/** The name of the database for WordPress */
define( 'DB_NAME', getenv('DB_NAME') );
/** MySQL database username */
define( 'DB_USER', getenv('DB_USER') );
/** MySQL database password */
define( 'DB_PASSWORD', getenv('DB_PASSWORD') );
/** MySQL hostname */
define( 'DB_HOST', getenv('DB_HOST') );
/** Database Charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );
/** The Database Collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
9000多个源码网站:https://www.httple.net
已有评论 ( 2 )
  • 头像
    tetepay (UID: 2470)
    (9000多个源码网站:https://www.httple.net)
    1楼

    在不用docker情况下,隐藏数据库信息,有大佬知道吗?

  • 头像
    tetepay (UID: 2470)
    (9000多个源码网站:https://www.httple.net)
    2楼

    隐藏数据库连接代码,docker隐藏

    /** Use MySQL over SSL */
    define( 'MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL );
    /** The name of the database for WordPress */
    define( 'DB_NAME', getenv('DB_NAME') );
    /** MySQL database username */
    define( 'DB_USER', getenv('DB_USER') );
    /** MySQL database password */
    define( 'DB_PASSWORD', getenv('DB_PASSWORD') );
    /** MySQL hostname */
    define( 'DB_HOST', getenv('DB_HOST') );
    /** Database Charset to use in creating database tables. */
    define( 'DB_CHARSET', 'utf8mb4' );
    /** The Database Collate type. Don't change this if in doubt. */
    define( 'DB_COLLATE', '' );
域名市场
   域名载入中...
创建新帖
自助推广购买广告位
确认删除
确定要删除这篇帖子吗?删除后将无法恢复。
删除成功
帖子已成功删除,页面将自动刷新。
删除失败
删除帖子时发生错误,请稍后再试。