Opened 11 years ago
Closed 11 years ago
#25797 closed defect (bug) (fixed)
wp_guess_url() broken with symlinks involved
Reported by: | bootc | Owned by: | dd32 |
---|---|---|---|
Milestone: | 3.8 | Priority: | normal |
Severity: | normal | Version: | 3.7 |
Component: | Upgrade/Install | Keywords: | has-patch |
Focuses: | Cc: |
Description
I was notified by a client that WordPress 3.7.1 was failing to install on their server. Essentially, the Apache DocumentRoot pointed at a location redirected using a symlink, and parts of the path pointed to by the symlink make their way into the URL during installation. This did not occur with WordPress 3.6. I developed a test case to replicate the problem:
- I installed a fresh Debian VM with a LAMP stack to test with.
mkdir -p /srv/var/www
rm -rf /var/www
ln -s /srv/var/www /var/www
- Extract WordPress 3.7.1 into
/srv/var/www
. - View the installation in a web browser.
- The Create a Configuration File link points at
http://server/srv/wp-admin/setup-config.php
instead ofhttp://server/wp-admin/setup-config.php
. Note the addition of /srv into the URL.
I'd say this was related to #25317, r25396, #24480, #16884, r25436.
Attachments (1)
Change History (10)
#3
in reply to:
↑ description
@
11 years ago
I can confirm that this also happens on FreeBSD. Had two clients report this today. However upgrading to 3.7 or 3.7.1 from 3.6.x works fine.
EDIT: This also happens with fresh 3.7 installs, not just 3.7.1.
#4
@
11 years ago
- Component changed from General to Upgrade/Install
- Version changed from 3.7.1 to 3.7
#5
@
11 years ago
- Milestone changed from Awaiting Review to 3.8
Since this was a change in 3.7, arguably a regression, moving to 3.8 pending patch that can then be back ported if appropriate.
#6
@
11 years ago
- Keywords has-patch reporter-feedback added
I wasn't able to duplicate this using the steps provided, but I was able to duplicate a similar issue when WordPress is installed in a subdirectory, and you're hitting an index.php in a higher level directory.
The string replace would replace /b/ in /a/b/c/ when it should be stripping off the /a/ as well, 25797.diff fixes that case.
I can't determine if that's the same problem as being reported here though, since the steps are radically different. Can you try the patch and see if it works for your case?
nginx unrolls symlinks in it's root, and Apache doesn't allow DocumentRoot to point to a Symlink (at least, not under default configurations), so the exact steps here were a bit hard to duplicate.
#7
@
11 years ago
I've just tested attachment:25797.diff by applying it on top of 3.7.1, and this fixes the problem for me.
dd32: Not sure why you couldn't replicate the issue with my instructions, perhaps you were missing Options FollowSymLinks
in your Apache configuration? It's on by default in Debian for /var/www.
Thanks!
I should add that the bug can be worked around by defining
WP_HOME
and/orWP_SITEURL
in thewp-settings.php
file, or by changing Apache'sDocumentRoot
to point at the directory with all symlinks expanded.