-2

Full path to working directory. Makes it possible to for example to have effective exclude path in apc. DIR breaks symlinked includes, but realpath() returns false if we don't have permissions on parent directories.

$IP = getenv( 'MW_INSTALL_PATH' );
if ( $IP === false ) {
    if( realpath( '.' ) ) {
        $IP = realpath( '.' );
    } else {
        $IP = dirname( __DIR__ );
    }
}

if ( $IP === false ) {
    if( realpath( '.' ) ) {
        $IP = realpath( '.' );
    } else {
        $dirnamefile = "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\w\";
        $IP = dirname( $dirnamefile );
    }
}

The code in second box was modified by me and the code above this is a default wiki code(mediawiki)

when I try to execute this I get this error Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\w\includes\WebStart.php on line 104

Can anybody help me on this?

nickb
  • 59,313
  • 13
  • 108
  • 143

1 Answers1

3

You're escaping the last quotation mark of your string, so the string doesn't terminate:

$dirnamefile = "C:\Program Files (x86)\Apache Software Foundation\...\w\";
                                                                       ^^

Change it to:

$dirnamefile = "C:\Program Files (x86)\Apache Software Foundation\...\w\\";

Note the added \.

nickb
  • 59,313
  • 13
  • 108
  • 143