[wp-trac] [WordPress Trac] #38312: Network setup step 2 throws warning in certain server setups

WordPress Trac noreply at wordpress.org
Fri Oct 14 14:31:03 UTC 2016


#38312: Network setup step 2 throws warning in certain server setups
--------------------------------+-----------------------------
 Reporter:  ruud@…              |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:  trunk
 Severity:  normal              |   Keywords:
  Focuses:  multisite           |
--------------------------------+-----------------------------
 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(
 $_SERVER['DOCUMENT_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

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38312>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list