Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#7997 closed defect (bug) (fixed)

Cannot use installer when installing WordPress in a sub directory of another install

Reported by: sivel's profile sivel Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.7.1
Component: General Keywords: has-patch commit
Focuses: Cc:

Description

Because WordPress now uses wp-load.php to look for wp-config.php in 1 directory up, that prevents you from installing WordPress (using the installer) in a sub directory of another install because the new install will use the wp-config.php for the other install.

I think the easiest way to fix this is to check to see if there is another wordpress file 1 directory up on level with wp-config.php which would signify that that wp-config.php is part of another install.

In my attached diff I am checking for the existence of wp-load.php on level with wp-config.php, but could be wp-settings.php or whatever.

I marked this as Milestone 2.7. Any chance we could work a fix in for 2.7? If not adjust accordingly.

Attachments (5)

wp-load.diff (561 bytes) - added by sivel 17 years ago.
setup-config.diff (874 bytes) - added by sivel 17 years ago.
7997.2.2.diff (1.7 KB) - added by sivel 17 years ago.
use wp-settings.php and add and fix comments of what we are doing
7997.2.diff (1.7 KB) - added by sivel 17 years ago.
use wp-settings.php and add and fix comments of what we are doing
7997.3.diff (1.7 KB) - added by sivel 17 years ago.

Download all attachments as: .zip

Change History (19)

@sivel
17 years ago

#1 @sivel
17 years ago

Looks like wp-admin/setup-config.php also needs a minor change.

@sivel
17 years ago

#2 @westi
17 years ago

  • Keywords 2nd-opinion added

I'm not sure I see a real use-case for supporting installs within directories within installs.

#3 @sivel
17 years ago

I have been helping someone for the past hour or so on IRC trying to install WordPress Mu in a subdirectory of a WordPress install.

On a side note I have had a staging and a dev site installed as subdirectories of another install since 2.3. I never ran into this issue because I have only been doing upgrades and not new installs since 2.6.

I'm not sure in general that there would be a real use-case for supporting this...but as I see it, if a user like the one I am helping wanted to do it for whatever reason it makes it very difficult unless you create the configuration manually from the sample.

#4 @thee17
17 years ago

Here is an example:

CEFM.ca uses wordpress /public-html/

CEFM.tv wants to use wordpress but is sharing at /public-html/cefmdottv/ but the install sees the /public-html/wp-config.php

#5 @sivel
17 years ago

Great example! I forgot about situations like that. Bluehost for one, places its subdomains as subdirectories of the public_html directory. Which would cause this issue if the main site was also WordPress.

#6 @sivel
17 years ago

I should add that with the case of Bluehost it's actually all addon domains whether subdomains or not.

#7 @MichaelH
17 years ago

Thought this should be considered a blocker for 2.7, but at least you can manually create the wp-config.php file and install WordPress in a sub-directory successfully, even if there is an existing installation in the web-root folder.

As a note, almost all cPanel based hosting arrangements will use public_html as the web-root folder for the 'main' domain associated with the hosting account.

If the "Giving WordPress its own Directory" technique [1] is used for the 'main' domain then this wouldn't be a problem in that scenario.

[1] http://codex.wordpress.org/Giving_WordPress_its_own_Directory

#8 @ryan
17 years ago

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

(In [9443]) Allow nested install. Props sivel. fixes #7997

#9 @sivel
17 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#10 @sivel
17 years ago

  • Keywords has-patch commit added; 2nd-opinion removed
  • Milestone changed from 2.7 to 2.8
  • Version changed from 2.7 to 2.7.1

#11 @sivel
17 years ago

  • Cc matt@… added

Attaching a new patch. It looks like using wp-settings.php as the other file to check may have been a better idea so that it works if the install one directory above was pre 2.6.

Can this patch also be applied to the 2.7 branch incase there is a 2.7.2 released before 2.8? I'm not sure of our plans to even release a 2.7.2 so there may be no need.

New patch is 7997.2.diff

@sivel
17 years ago

use wp-settings.php and add and fix comments of what we are doing

@sivel
17 years ago

use wp-settings.php and add and fix comments of what we are doing

@sivel
17 years ago

#12 @sivel
17 years ago

Damn browser double posted. Updated patch to 7997.3.diff so there isn't confusion about the correct diff.

#13 @ryan
17 years ago

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

(In [10698]) Nested install fixes. Props sivel. fixes #7997 for trunk

#14 @ryan
17 years ago

(In [10699]) Nested install fixes. Props sivel. fixes #7997 for 2.7

Note: See TracTickets for help on using tickets.