Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#43188 closed defect (bug) (duplicate)

"Use of undefined constant" in /wp-includes/load.php under PHP 7.2

Reported by: bugnumber9 Owned by:
Priority: normal Milestone:
Component: Bootstrap/Load Version: 4.9.2
Severity: normal Keywords: reporter-feedback
Cc: Focuses:

Description

As the title says:

PHP Warning:  Use of undefined constant DB_NAME - assumed 'DB_NAME' (this will throw an Error in a future version of PHP) in .../wp-includes/load.php on line 404
PHP Warning:  Use of undefined constant DB_HOST - assumed 'DB_HOST' (this will throw an Error in a future version of PHP) in .../wp-includes/load.php on line 404
PHP Warning:  Use of undefined constant DB_USER - assumed 'DB_USER' (this will throw an Error in a future version of PHP) in .../wp-includes/load.php on line 404
PHP Warning:  Use of undefined constant DB_PASSWORD - assumed 'DB_PASSWORD' (this will throw an Error in a future version of PHP) in .../wp-includes/load.php on line 404

This pops up in PHP error log from time to time.

Change History (4)

#1 @danieltj
9 years ago

  • Keywords reporter-feedback added

This looks like the wp-config.php file is not present as those constants should always be available.

#2 @bugnumber9
9 years ago

It's a live website, so the config file is definitely there.

#3 @SergeyBiryukov
9 years ago

  • Component GeneralBootstrap/Load

Sounds like something on that site is calling require_wp_db() before wp-config.php is included.

Does it happen on a clean install with all plugins disabled and a default theme (Twenty Seventeen) activated?

#4 @dd32
9 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

I'm going to mark this as a duplicate of #35560 as that's the root cause.

Even though there's probably some user-code doing something strange on the install, it could also just be being triggered by a not-yet-installed (or in progress) install of WordPress and that will fix it as far as core is concerned.

Note: See TracTickets for help on using tickets.