英文:
Including wp-config.local.php file
问题
我已经按照本地开发WordPress项目的设置说明进行了设置。
我想在wp-config.php中定义一些额外的常量,但根据https://ddev.readthedocs.io/en/latest/users/quickstart/#adding-configuration上的文档建议,在wp-config-ddev.php之后加载wp-config-local.php。
如果wp-config.php由ddev管理,那里的更改会在'ddev start'上被覆盖,那么建议的方法是如何包含wp-config-local.php以进行所需的更改?
我可以删除'#ddev-generated: Automatically generated WordPress settings file.'以允许更改wp-config.php文件,但这似乎与建议的方法不符。
英文:
I have followed the setup instruction for local development of a wordpress project.
I am wanting to define some additional constants in wp-config.php, but referring to the documentation at https://ddev.readthedocs.io/en/latest/users/quickstart/#adding-configuration, it suggests loading a wp-config-local.php after wp-config-ddev.php.
If the wp-config.php is managed by ddev, and changes there are overwritten on 'ddev start', what is the recommended way to include a wp-config-local.php to make my required changes?
I can remove the '#ddev-generated: Automatically generated WordPress settings file.' to enable changes to the wp-config.php file, but this doesn't seem to align with the suggested approach.
答案1
得分: 0
在这里的想法是查看WP配置文件,该文件不由DDEV管理,其中包括wp-config-ddev.php
。在那个文件中,在包含wp-config-ddev.php
之后,包含您的wp-config-local.php
。根据您拥有的WP布局类型,有许多方法可以实现这一点...但是如果WordPress对您有用,那么wp-config-ddev.php
会在某个地方被包含。找出在哪里,然后在它加载后立即加载您想要添加的配置。
英文:
The idea here is that you look at the WP config file that is not managed by DDEV, the one that includes the wp-config-ddev.php
. In that file, after wp-config-ddev.php
is included, include your wp-config-local.php
. There are many ways to do this depending on the type of WP layout you have... but if WordPress is working for you, then wp-confid-ddev.php
is being included somewhere. Figure out where, and right after it gets loaded, load the configuration you want to add.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论