r5 - 27 Jun 2004 - 14:15:18 - SvenDowideitYou are here: TWiki >  Codev Web > ModPerl > ChangeToScriptDirForModPerl
Tags:
, create new tag
Spec change for TWiki scripts:

All TWiki scripts change first to the script directory. This fixes a problem under mod_perl 2.0 / Apache 2.0 where mod_perl does not set the current working directory to the script directory. This fix does not affect standard CGI Perl mode and shell mode. Patch provided by JohannesMartin in ModPerl.

All TWiki scripts are changed to this: (red code is new)

BEGIN {
    # Set default current working directory (needed for mod_perl)
    if( $ENV{"SCRIPT_FILENAME"} && $ENV{"SCRIPT_FILENAME"} =~ /^(.+)\/[^\/]+$/ ) {
        chdir $1;
    }
    # Set library paths in @INC, at compile time
    unshift @INC, '.';
    require 'setlib.cfg';
}

This is now in TWikiAlphaRelease for CairoRelease and at TWiki.org.

-- PeterThoeny - 26 Oct 2003

Peter, I've noticed a fair number of (probably minor) changes recorded today and just wanted to say thank you (without putting a thank you on each page).

Thank you!

-- RandyKramer - 26 Oct 2003

Changed from FeatureDone to BugResolved as this was a bug for mod_perl2 users while being an invisible change to all others.

-- MattWilkie - 18 Dec 2003

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r5 < r4 < r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo