Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 7 years ago

#9166 closed feature request (wontfix)

Installer should check that required constants are defined

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Upgrade/Install Keywords: needs-patch
Focuses: Cc:


Beside the fact, that you can come more or less often to the point to start a flame-war because WordPress is designed to have the static configuration settings in a PHP File, some things can be done to improve the installation-easyness and provide better hints to this error-prone way of setting something up.

For Example: WordPress does not verify that really needed config PHP-Constants _are_ defined. Let's assume a user does not understand the configuration and enters the following in wp-config.php

define('90a83383_dbYZ', 'putyourdbnamehere'); Der Name der Datenbank, die du benutzt.
define('90a83383_unZUF1', 'usernamehere');
Dein MySQL-Datenbank-Benutzername.
define('xxx', 'yourpasswordhere'); Dein MySQL-Passwort.

then the wordpress error message that the connection to the db server failed does not reflect the fact, that the constants DB_NAME, DB_USER or DB_PASSWORD are not defined. Putting out this message clearly, that wp-config.php is not properly configured and the database configuration should be checked would help much instead.

Attachments (1)

9166.patch (761 bytes) - added by hakre 13 years ago.
Such a check function placed in wp-settings.php

Download all attachments as: .zip

Change History (19)

#1 @mrmist
13 years ago

  • Keywords install added
  • Milestone changed from 2.7.2 to 2.8
  • Summary changed from Missing propper check transparently for needed config constants to Installer should check that required constants are defined

#2 @hakre
13 years ago

Maybe #6631 is of interest as well to improve the installing experience.

13 years ago

  • Milestone changed from 2.8 to Future Release

#4 @hakre
13 years ago

The compontent that use such constants should throw the error in case they need them obligatory.

#5 @Denis-de-Bernardy
13 years ago

suggesting wontfix on this. I mean, if a user can't create a wp-config file, he should use fantastico to install his site, or get hosted on

#6 @DD32
13 years ago

Except that WordPress offers to create the wp-config.php file, which makes that arguement completely null.

A short message along the lines of (with better grammer of course) after including wp-config.php could possibly solve a few peopel getting confused.. But.. Hopefully theres enough documentation in the sample file already to explain it.

if ( ! defined('DB_PASS') )
die('wp-config is not configured properly. Please check the config defines');

#7 @Denis-de-Bernardy
13 years ago

  • Keywords needs-patch added; configuration install removed

needs a patch then

13 years ago

Such a check function placed in wp-settings.php

#8 @hakre
13 years ago

First patch. What I do not like is the fact that this code will be executed with every request. So maybe such code should be placed in the wp-config-sample file with a comment that it can be removed if everything works.

that will prevent that it is executed on setups that use the installer as DD32 pointed out.

#9 @hakre
13 years ago

  • Keywords has-patch developer-feedback added; needs-patch removed

#10 @hakre
13 years ago

  • Component changed from Administration to Upgrade/Install
  • Owner anonymous deleted

#11 @Denis-de-Bernardy
13 years ago

  • Keywords dev-feedback added; developer-feedback removed
  • Milestone changed from Future Release to 2.8

#12 @Denis-de-Bernardy
13 years ago

  • Keywords tested added

#13 @Denis-de-Bernardy
13 years ago

  • Keywords commit added; dev-feedback removed

any interest?

#15 @ryan
13 years ago

Is this much of a problem in practice? Regardless, I'd rather have a separate diagnostics tool. "Having a problem? Run this tool to see what's wrong." That way we're not doing these checks on every page load.

#16 @Denis-de-Bernardy
13 years ago

  • Keywords needs-patch added; has-patch tested commit removed

I don't thinks so... my own opinion above:

#17 @ryan
13 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

#18 @DrewAPicture
7 years ago

  • Milestone 2.8 deleted
Note: See TracTickets for help on using tickets.