WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#12029 closed defect (bug) (invalid)

SCRIPT_NAME with CGI script in subdirectory causes failed install

Reported by: wpmuguru Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Multisite Keywords: needs-feedback
Focuses: Cc:

Description

MU Trac Ticket: http://trac.mu.wordpress.org/ticket/502

Background: I have had some difficulty trying to install WordPress? MU for a client (a major university). In this case, PHP is available as CGI, rather than as an Apache Module. The _SERVERSCRIPT_FILENAME? variable is reported as /cgi-php5/php. I managed to resolve the issues through use of a workaround - which I detail below. In this case

Affected functions: Initial installation and usage.

Steps to replicate:

  • Install Apache.
  • Install PHP as CGI, within a subdirectory of the cgi-bin.
  • Attempt to install WordPress? MU.

Analysis:

The "regular" installation instructions will not install WordPress MU.

The problematic _SERVER scoped variables are: _SERVERSCRIPT_FILENAME? which is reported as /usr/local/opt/php/php-5.2.1/bin/php . _SERVERSCRIPT_NAME? which is reported as /cgi-php5/php .

The misconfiguration in the generated configuration files includes:

  • $base in generated wp-config.php incorrectly defined as 'cgi-php5'.
  • RewriteBase? in generated .htaccess incorrectly defined as 'cgi-php5'.
  • the following database values are set incorrectly:

tables for multi-user support:
table name column name column value
wp_blogs path /cgi-php5/
wp_site path /cgi-php5/

the default blog:
table name column name column value
wp_1_comments comment_author_url http://ucl.ac.uk/cgi-php5/
wp_1_options siteurl http://ucl.ac.uk/cgi-php5/
wp_1_options home http://ucl.ac.uk/cgi-php5/
wp_1_options fileupload_url http://ucl.ac.uk/cgi-php5/files

Change History (4)

comment:1 @wpmuguru5 years ago

Is this an issue with WordPress? If not, this probably will not affect enabling a network of sites.

comment:2 @sivel5 years ago

I would tend to say this is not a WordPress problem but a fastcgi configuration problem.

Most webservers and fastcgi implementations give configuration options to make sure that SCRIPT_FILENAME is populated correctly:

lighttpd:
"broken-scriptfilename" => "enable" http://redmine.lighttpd.net/wiki/1/Docs:ModFastCGI#FastCGI-and-Programming-Languages
nginx:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; http://wiki.nginx.org/PHPFcgiExample
php.ini:
cgi.fix_pathinfo = 1

comment:3 @wpmuguru5 years ago

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

I was wondering about the configuration as well. Fastcgi under nginx needs that cgi.fix_pathinfo = 1 as well.

comment:4 @nacin5 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.