[wp-trac] [WordPress Trac] #38204: enhancement: custom pathname to wp-config.php

WordPress Trac noreply at wordpress.org
Thu Oct 20 18:18:32 UTC 2022


#38204: enhancement: custom pathname to wp-config.php
-------------------------------------------------+-------------------------
 Reporter:  gdamjan                              |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Bootstrap/Load                       |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-refresh 2nd-opinion  |     Focuses:
-------------------------------------------------+-------------------------

Comment (by iandunn):

 One drawback here might be that PHP's
 [https://www.php.net/manual/en/ini.core.php#ini.open-basedir open_basedir]
 would need to be configured to allow access outside the webroot, which
 should be done carefully (especially if the config is placed in `/etc`).

 IIRC, some plugins and WP-CLI would need to be updated as well.

 This doesn't address your desire for a standard mechanism, but another
 alternate approach would be keeping the non-sensitive values hardcoded
 (`WP_LANG`, `WP_DEBUG`, etc) in `wp-config`, and then using
 [https://roots.io/twelve-factor-03-config/ env vars for the sensitive
 values]. e.g.,

 `define( 'DB_PASSWORD', getenv( 'WP_DB_PASSWORD' ) );`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/38204#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list