Opened 5 years ago

Closed 5 years ago

#7397 closed enhancement (fixed)

"99% chance you won't need to change this" in wp-config.php

Reported by: RanYanivHartstein Owned by: anonymous
Priority: lowest Milestone: 2.7
Component: General Version:
Severity: trivial Keywords: has-patch
Cc:

Description

In wp-config.php, regarding the database hostname, it says "99% you don't have to change this". According to the Codex, many popular hosting providers actually do use a different hostname. Couldn't this a confusing for new users?

Attachments (4)

7397.patch (577 bytes) - added by mrmist 5 years ago.
Changed text to You can get this info from your hosting provider
7397_setupconfig.patch (508 bytes) - added by mrmist 5 years ago.
Altered text around sql host
7397.wp-config-sample.php.r8339.diff (748 bytes) - added by RanYanivHartstein 5 years ago.
Alternative suggestion, adds an extra comment that refers to hosting providers for all info
wp7397.diff (689 bytes) - added by lloydbudd 5 years ago.
Patch removing comment from DB_HOST, and general comment at the top of section

Download all attachments as: .zip

Change History (30)

It is a confusing thing for many new users. Haven't seen it recently, but it was once very commonplace on the support forums.

Suggest removing the comment or replacing it with something like "get this info from your host".

mrmist5 years ago

Changed text to You can get this info from your hosting provider

  • Keywords has-patch added

Well that seems easy enough ;)

  • Priority changed from normal to lowest
  • Severity changed from normal to trivial

You need to update the wp-config create page, which also has the message and the readme.php HTML page.

mrmist5 years ago

Altered text around sql host

Added patch for setup-config (based on 2.6). Not sure what needs to change in any readme files.

I think it should be mentioned somewhere that one should try localhost before giving up completely.

(Unfortunately, English is not my native language, so I'll leave it to someone else to put the words together.)

  • Keywords commit added

Please commit.

comment:9 follow-up: ↓ 10   filosofo5 years ago

The original text is accurate because the vast majority of people setting up WordPress do not have to change "localhost."

The wording of the patches is unhelpful, because it suggests that people need to find out their database host information, when most of the time they don't. It creates more effort for most people without providing a significant advantage for the minority, who either way must look up their host name.

If this is really a problem for some users, a better solution might be a more specific error message when the host is unreachable. Or maybe a combination of the two messages: "Your database host name is probably "localhost," but your hosting provider can tell you for sure."

comment:10 in reply to: ↑ 9 ; follow-up: ↓ 11   Otto425 years ago

Replying to filosofo:

The original text is accurate because the vast majority of people setting up WordPress do not have to change "localhost."

How exactly do you figure that? I've *never* seen any hosting provider run their mysql and web servers on the same boxes. Ever. Not even once. Period.

The vast majority of people DO have to change that variable to something else. No real hosting services will work with "localhost" there.

comment:11 in reply to: ↑ 10   filosofo5 years ago

Replying to Otto42:

How exactly do you figure that? I've *never* seen any hosting provider run their mysql and web servers on the same boxes. Ever. Not even once. Period.

If this page is accurate, 2/3 of the recommended hosts use "localhost."

I guess my personal experience is biased the other way, because I tend to work with people using dedicated servers, but you're the WP.org support maven, so I'll take your word for it.

Most people don't use dedicated hosts, they use shared ones.

And I would debate the accuracy of that codex page. While I've not used most of those hosts, I have seen setups on many of them. BlueHost, to pick the first example, definitely does NOT use "localhost" on their shared hosting services.

I can confirm that one.com is using localhost.

My personal experience: 3 out of 4 smaller shared-hosting-providers I've been using over the last year have been using localhost. Still, I too will take Otto42's word for that my personal experience doesn't match the larger picture.

comment:14 follow-up: ↓ 16   Otto425 years ago

Well, 3 out of 4 is 75%, not 99%. ;-)

I just think that the current wording sucks, and causes confusion. Look around at the number of people who claim to be in the "1%", it's not minor. Google found several examples.

I don't claim to know what the wording should actually be, but "you probably won't need to change this" is not particularly helpful when the user DOES need to change it. It should say something about what the setting is, what it is for, and probably where the user can find out what to fill in for it.

Because people do not see it as something that they have to worry about, they get mighty confused when they use the 1 out of 4 hosts that do require changing it. It is a setting that they need to know about, and the wording should reflect that.

The smaller shared hosting are most likely using a dedicated machine and just selling pieces of it. So yeah, that would mean that everything would be on the same machine. It isn't really a shared host, just a reseller of a dedicated hosting.

It isn't optimal to have the web server and the database server on the same machine. It is if you don't want network latency, but if you get a lot of traffic then you'll have the two processes competing over server resources.

Regardless, the statement is ambiguous and a slap in the fact every time I have to change it. I also make a lot of installations of WordPress, the only time it is convenient is, when I'm testing WordPress on my local machine. It is unknown just how many hosts the ratio is, so saying any number is still not cool.

"You probably don't have to change this." Might be better wording.

comment:16 in reply to: ↑ 14   santosj5 years ago

Replying to Otto42:

Because people do not see it as something that they have to worry about, they get mighty confused when they use the 1 out of 4 hosts that do require changing it. It is a setting that they need to know about, and the wording should reflect that.


Which is why I liked the wording about getting the information from your host. I don't agree with the commenter about how it is confusing. You need to get that information anyway from your host. It might be a pain in the ass to find it sometimes.

Alternative suggestion, adds an extra comment that refers to hosting providers for all info

I added a second alternative - a patch to add an extra comment before everything that states that all the MySQL information should be available from the hosting provider, and a different comment for DB_HOST that explains what it is and mentions 'localhost' as a common default

comment:18 in reply to: ↑ 17   santosj5 years ago

Replying to RanYanivHartstein:

I added a second alternative - a patch to add an extra comment before everything that states that all the MySQL information should be available from the hosting provider, and a different comment for DB_HOST that explains what it is and mentions 'localhost' as a common default


+1

comment:19 in reply to: ↑ 17   dnusim5 years ago

Replying to RanYanivHartstein:

attachment 7397.wp-config-sample.php.r8339.diff added.

+1

comment:20 in reply to: ↑ 17   mrmist5 years ago

Replying to RanYanivHartstein:

I added a second alternative - a patch to add an extra comment before everything

Yep. That looks better than my version.

+1, commit...

comment:22 follow-up: ↓ 23   jacobsantos5 years ago

  • Keywords needs-patch added; has-patch removed

yeah, the current patch isn't going to commit, changed over to PHPdoc.

comment:23 in reply to: ↑ 22 ; follow-up: ↓ 25   lloydbudd5 years ago

Replying to jacobsantos:

yeah, the current patch isn't going to commit, changed over to PHPdoc.

I think that has been reverted.

In most shared hosting environments, I've used or helped ppl with localhost is mostly used. And because I've sometimes been able to still access the database when the host was down, I assume it's sometimes a configuration trick.

Based on this discussion though, it seems best to remove any comment from the DB_HOST line.

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

Patch removing comment from DB_HOST, and general comment at the top of section

comment:25 in reply to: ↑ 23   caesarsgrunt5 years ago

  • Summary changed from "99% you don't have to change this" in wp-config.php to "99% chance you won't need to change this" in wp-config.php

Replying to lloydbudd:

I think that has been reverted.

Yes, it has. Quick, let's get this patch in before the new phpdoc attempt is committed! :p

In most shared hosting environments, I've used or helped ppl with localhost is mostly used. And because I've sometimes been able to still access the database when the host was down, I assume it's sometimes a configuration trick.

Based on this discussion though, it seems best to remove any comment from the DB_HOST line.

Yes, I agree with both points.

But I think 7397.wp-config-sample.php.r8339.diff was better than wp7397.diff; the host line still needs some comment.

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

(In [8817]) Improved phpdoc for wp-config-sample.php fixes #7397 and #7526 props lloydbudd and jacobsantos.

Note: See TracTickets for help on using tickets.