Make WordPress Core

Opened 7 years ago

Closed 3 years ago

#40573 closed defect (bug) (invalid)

Problem with wp_guess_url() during installation

Reported by: pavelevap's profile pavelevap Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8
Component: General Keywords: reporter-feedback close
Focuses: Cc:


After uploading installation files, I went to and then I was redirected to, but it should be URL works well. When I manually changed URL to then everything worked well but initial redirect caused problems for many users which did not notice that and installed WP with this URL.

Popular webhoster is using .htaccess to allow installation more sites into subdirectories, but problem is probably inside wp_guess_url() function here:

$script_filename_dir . '/' == $abspath_fix == /data/web/virtuals/160423/virtual/www/domains/

But $_SERVER['PHP_SELF'] is /domains/

There should be $_SERVER['REQUEST_URI'] or $_SERVER['REQUEST_URI'] . 'index.php' instead?

Change History (3)

#1 in reply to: ↑ description @dd32
7 years ago

  • Keywords reporter-feedback added

Replying to pavelevap:

$script_filename_dir . '/' == $abspath_fix == /data/web/virtuals/160423/virtual/www/domains/

But $_SERVER['PHP_SELF'] is /domains/

It looks like your host has an invalid value in PHP_SELF - based on your description of the URLs it should only contain /index.php according to the PHP Documentation:

Ideally this should be brought to the attention of the web-host before WordPress attempts any form of work around here, as it's common practice for other PHP scripts to use something similar to <form action="<?php echo $_SERVER['PHP_SELF']; ?>"> (please don't do that kids, I'm fairly sure that'll introduce security implications)

Have you contacted your web-host about this yet? What did they say?

#2 @hellofromTonya
4 years ago

  • Keywords close added

Hello @pavelevap,

Welcome to WordPress Trac!

Was your web host able to resolve this? If yes, what did they find?

I'm marking this ticket as a close candidate. Why? As Dion notes, it's likely due to the host:

It looks like your host has an invalid value in PHP_SELF

Plus, it's been over 4 years since reporter feedback was requested. Will review when/if reporter feedback provided.

#3 @hellofromTonya
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

I'm closing this ticket. However, if the problem persists, please reopen and provide more information to help us further investigate.

Note: See TracTickets for help on using tickets.