admin管理员组文章数量:1122846
There doesn't appear to be a wp-config.php file in the root folder of my wp install. There is one in the file directory up but it doesn't provide any of the usual details, it only shows as per the below:
<?php
/**
* Do not edit this file. Edit the config files found in the config/ dir instead.
* This file is required in the root directory so WordPress can find it.
* WP is hardcoded to look in its own directory or one directory up for wp-config.php.
*/
require_once(dirname(__DIR__) . '/vendor/autoload.php');
require_once(dirname(__DIR__) . '/config/application.php');
require_once(ABSPATH . 'wp-settings.php');"
There doesn't appear to be a wp-config.php file in the root folder of my wp install. There is one in the file directory up but it doesn't provide any of the usual details, it only shows as per the below:
<?php
/**
* Do not edit this file. Edit the config files found in the config/ dir instead.
* This file is required in the root directory so WordPress can find it.
* WP is hardcoded to look in its own directory or one directory up for wp-config.php.
*/
require_once(dirname(__DIR__) . '/vendor/autoload.php');
require_once(dirname(__DIR__) . '/config/application.php');
require_once(ABSPATH . 'wp-settings.php');"
Share
Improve this question
edited May 21, 2024 at 16:33
Tom J Nowell♦
60.7k7 gold badges77 silver badges147 bronze badges
asked May 21, 2024 at 16:22
WillWill
32 bronze badges
1 Answer
Reset to default 1There is one in the file directory up
That is your wp-config.php
, WordPress can look one folder up so that you can place the file in a folder that's not served to the web. This is done as a security measure.
it doesn't provide any of the usual details
wp-config.php
is still a PHP file, as long as loading that file defines what's needed you don't need to do it the normal way. Your wp-config.php
could bootstrap a whole other CMS and query it for the database details/login/prefix/etc, or fire a remote request!
On some of the sites I work with, the constants are placed in individual files so that I can conditionally load them based on the environment, e.g. wp-local-config.php
might be loaded for local development, but not on the production server, providing different DB details and constants.
Instead it looks like your wp-config.php
does 3 things:
- Load the Composer autoloader for Composer packages and other stuff in the
vendor
folder - Load a
config/application.php
that takes care of all the constants such as DB host etc - Loads
wp-settings.php
as allwp-config.php
files are supposed to do
本文标签: Updating wpconfigphp but it doesnt seem to exist
版权声明:本文标题:Updating wp-config.php but it doesnt seem to exist 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736306453a1932964.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论