首页 > 解决方案 > 如何在嵌套子域上安装 WordPress?

问题描述

如何在嵌套子域(例如:project1.dev.website.com)上安装 WordPress?

我只是得到一个白屏,但是当我编辑它index.php以包含echo "Test";它时,它会出现在屏幕上。

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */

define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );

echo "Test";

此代码输出:

输出:测试

我究竟做错了什么?

标签: wordpressinstallation

解决方案


解决方案

  1. 创建新的 PHP 文件“wp-config.php”

  2. 打开“wp-config-sample.php”复制所有代码并将其粘贴到“wp-config.php”中

  3. 现在开始使用您的数据库详细信息编辑“wp-config.php”
  4. https://api.wordpress.org/secret-key/1.1/salt/获取安全密钥
  5. 完毕!

    感谢肯尼福克斯的帮助。

    编辑 wp-config.php(关于使用 wp-config.php 的完整文档):https ://codex.wordpress.org/Editing_wp-config.php

推荐阅读