Make WordPress Core

Opened 8 years ago

Last modified 5 years ago

#38312 new defect (bug)

Network setup step 2 throws warning in certain server setups

Reported by: ruudjoyo's profile ruud@… Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5
Component: Networks and Sites Keywords:
Focuses: multisite Cc:

Description

Hi,

I got this error on my local server:
Warning: Strpos(): Empty delimiter in wp-admin\includes\network.php line 344

I tracked this down to line:
$home_path = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : get_home_path();

After some more digging, it seems to me that it's possible that this line is causing the initial problem:
$document_root_fix = str_replace( '
', '/', realpath( $_SERVERDOCUMENT_ROOT? ) );

Since realpath() can be false in some server setups, $document_root_fix can be empty as well (hence the error)

From http://stackoverflow.com/questions/7906513/realpath-returns-empty-string:

Note: The running script must have executable permissions on all directories in the hierarchy, otherwise realpath() will return FALSE.

So your web server should have access also to pre-webroot directories.

Leaving us with perhaps unexpected behavior of the lines following.

I'm not quite sure what to do next, since the next couple of lines are quite hard to grasp.

Thanks,
Ruud

Change History (1)

#1 @jeremyfelt
8 years ago

  • Version changed from trunk to 3.5

Hi @ruud@…, thanks for opening a ticket. I haven't looked too closely yet, but this can be tracked back to #23073, which has some good background discussion / testing on this area.

Note: See TracTickets for help on using tickets.