Opened 4 years ago
Closed 4 years ago
#9166 closed feature request (wontfix)
Installer should check that required constants are defined
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.8 |
| Component: | Upgrade/Install | Version: | 2.7 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: |
Description
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)
Change History (18)
- 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
The compontent that use such constants should throw the error in case they need them obligatory.
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 wordpress.com
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');
- Keywords needs-patch added; configuration install removed
needs a patch then
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.
comment:10
hakre — 4 years ago
- Component changed from Administration to Upgrade/Install
- Owner anonymous deleted
- Keywords dev-feedback added; developer-feedback removed
- Milestone changed from Future Release to 2.8
- Keywords tested added
- Keywords commit added; dev-feedback removed
any interest?
comment:15
ryan — 4 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.
- Keywords needs-patch added; has-patch tested commit removed
I don't thinks so... my own opinion above:
comment:17
ryan — 4 years ago
- Resolution set to wontfix
- Status changed from new to closed

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