Uncaught Error: Undefined constant “WP_CONTENT_DIR”

Yes, this is a bug, but it appear only when the WP configuration is not finished.

The error occurs on this line (in wp-includes/load.php) :

  if ( ! extension_loaded( 'mysql' ) 
       && ! extension_loaded( 'mysqli' ) 
       && ! extension_loaded( 'mysqlnd' ) 
       && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
(...)

This checks that mysql extension is installed, and tries several things for this.
The last check will not work because WP_CONTENT_DIR is not defined yet at this stage.

The logical way to fix this is to ignore this error, and install PHP mysql extension, like so (in Debian) :

sudo apt install php-mysql

tech