From 6d5e0be5ef21cd74ebf4aae86829b1a5d2c61c93 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Thu, 10 Nov 2005 23:57:45 +0000 Subject: [PATCH] Fixes #1591 (again) git-svn-id: https://develop.svn.wordpress.org/trunk@3034 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-settings.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wp-settings.php b/wp-settings.php index 6d9c4a8463..f1544acd4a 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -34,6 +34,14 @@ if ( empty( $_SERVER['REQUEST_URI'] ) ) { } } +// Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests +if ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7 ) + $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; + +// Fix for PHP as CGI hosts that set PATH_INFO to PHP_SELF value +if ( $_SERVER['PATH_INFO'] == $_SERVER['PHP_SELF'] ) + unset($_SERVER['PATH_INFO']); + if ( !(phpversion() >= '4.1') ) die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' );