WordPress.org

Make WordPress Core

Changes between Initial Version and Version 3 of Ticket #35560


Ignore:
Timestamp:
01/22/2016 01:55:04 AM (3 years ago)
Author:
dd32
Comment:

It also occurs when you do have a wp-config.php but still have to run the setup of wordpress.

That shouldn't happen, as if you have a wp-config.php file, then those constants should already be defined.

The only scenario where these notices can be generated is when WordPress is yet to have a valid wp-config.php generated for it, or the file lacks those constants because it's using a wp-content/db.php dropin which doesn't use those constants.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35560

    • Property Keywords reporter-feedback added
    • Property Version changed from 4.4.1 to
  • Ticket #35560 – Description

    initial v3  
    88
    99# Solution 1, prepend above the "new wpdb()":
     10{{{
    1011    if (!defined('DB_USER')) {
    1112        define('DB_USER', null);
     
    2021        define('DB_HOST', null);
    2122    }
     23}}}
    2224
    2325# Solution 2, modify the "new wpdb()" line:
    24 $wpdb = new wpdb( @DB_USER, @DB_PASSWORD, @DB_NAME, @DB_HOST );
     26{{{$wpdb = new wpdb( @DB_USER, @DB_PASSWORD, @DB_NAME, @DB_HOST );}}}
    2527
    2628Where I would prefer to use solution 1.