Ticket #753 (closed maintenance: fixed)

Opened 2 years ago

Last modified 2 years ago

wiki.transitionnetwork.org displaying error

Reported by: chris Owned by: chris
Priority: major Milestone: Maintenance
Component: Mediawiki Keywords:
Cc: ed Estimated Number of Hours: 0.0
Add Hours to Ticket: 0 Billable?: yes
Total Hours: 0.35

Description (last modified by chris) (diff)

This is rather weird, the site was working yesterday, now at https://wiki.transitionnetwork.org/ we have:

bar(), etc etc) which throw parse errors in # PHP 4. Setup.php and ObjectCache.php have structures invalid in PHP 5.0 and # 5.1, respectively. if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) { // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+ require dirname( __FILE__ ) . '/includes/PHPVersionError.php'; wfPHPVersionError( 'index.php' ); } require __DIR__ . '/includes/WebStart.php'; $mediaWiki = new MediaWiki(); $mediaWiki->run(); 

Change History

comment:1 Changed 2 years ago by chris

  • Description modified (diff)

comment:2 Changed 2 years ago by chris

  • Add Hours to Ticket changed from 0.0 to 0.35
  • Status changed from new to closed
  • Resolution set to fixed
  • Total Hours changed from 0.0 to 0.35

We are not the first people with this error:

The page being displayed is the index.php file as plain text, this is the content of the file:

<?php
/**
 * This is the main web entry point for MediaWiki.
 *
 * If you are reading this in your web browser, your server is probably
 * not configured correctly to run PHP applications!
 *
 * See the README, INSTALL, and UPGRADE files for basic setup instructions
 * and pointers to the online documentation.
 *
 * https://www.mediawiki.org/
 *
 * ----------
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 * @file
 */

# Bail on old versions of PHP.  Pretty much every other file in the codebase
# has structures (try/catch, foo()->bar(), etc etc) which throw parse errors in
# PHP 4. Setup.php and ObjectCache.php have structures invalid in PHP 5.0 and
# 5.1, respectively.
if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
        // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
        require dirname( __FILE__ ) . '/includes/PHPVersionError.php';
        wfPHPVersionError( 'index.php' );
}

require __DIR__ . '/includes/WebStart.php';

$mediaWiki = new MediaWiki();
$mediaWiki->run();

So it looks like a Nginx config issue. Some changes were made yesterday to enable large files to be uploaded on ticket:719.

Also this line in /etc/nginx/sites-enabled/10-wiki:

        #location ~ /(api|index|opensearch_desc|redirect|trackback|img_auth|load|thumb)\.php?$ {
        location ~ /(api|img_auth|index|load|opensearch_desc|profileinfo|thumb|thumb_handler?)$ {

Was edited. the old version being commented out, as it had started generating errors yesterday, the closing ) bracket was added.

Don't think this was related to a Nginx upgrade, the last one was 3 weeks ago, ticket:692#comment:51

Edited the above to:

        # Pass php requests to php5-fpm
        # https://tech.transitionnetwork.org/trac/ticket/753
        #location ~ /(api|index|opensearch_desc|redirect|trackback|img_auth|load|thumb)\.php?$ {
        location ~ /(api|img_auth|index|load|opensearch_desc|profileinfo|thumb|thumb_handler)\.php$ {

I think the mistake in the regular expression must have crept in when trying to resolve the problems with the last MediaWiki upgrade, ticket:736, it's now resolved.

Note: See TracTickets for help on using tickets.