Page Index Toggle Pages: 1
Topic Tools
Normal Topic Problem in Setup.pl and in function fatal_error in Subs.pl (Read 1,118 times)
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,174
Location: Earth

YaBB 2.6.0
Re: Problem in Setup.pl and in function fatal_error in Subs.pl
Reply #3 - Dec 16th, 2012 at 6:17am
Post Tools
Thank you.  Smiley
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Gomez Addams
YaBB Newcomer
*
Offline



Posts: 5

None
Re: Problem in Setup.pl and in function fatal_error in Subs.pl
Reply #2 - Dec 14th, 2012 at 6:49pm
Post Tools
Yes.
  
Back to top
 
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,174
Location: Earth

YaBB 2.6.0
Re: Problem in Setup.pl and in function fatal_error in Subs.pl
Reply #1 - Dec 13th, 2012 at 10:10pm
Post Tools
Thank you, thank you. Most of us testers are either using *nix machines with Apache or XP and Apache.

So input from IIS users is extremely valuable.  Smiley

So to get this right, that section in Setup.pl should be:
Code
Select All
### Requirements and Errors ###
$script_root = $ENV{'SCRIPT_FILENAME'};
$script_root =~ s/\/Setup\.(pl|cgi)//ig;
if( ! $script_root ) {
   $script_root = $ENV{'PATH_TRANSLATED'};
   $script_root =~ s!\\!\/!g;
}
 

« Last Edit: Dec 13th, 2012 at 10:17pm by Dandello »  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Gomez Addams
YaBB Newcomer
*
Offline



Posts: 5

None
Problem in Setup.pl and in function fatal_error in Subs.pl
Dec 12th, 2012 at 2:53pm
Post Tools
Toward the top of Setup.pl, it tries to get the root directory by looking at the environment variable SCRIPT_FILENAME. This doesn't seem to exist in IIS 7.

The fix is to add this
Code (Perl)
Select All
if( ! $script_root ) {
   $script_root = $ENV{'PATH_TRANSLATED'};
   $script_root =~ s!\\!\/!g;
}
 



The problem with fatal_error() is that it can call template() before template's file path variables are set causing template() to die. If it happens early enough, the HTTP headers won't have been sent, and die()'s message is interpreted by the browser as headers leading to the 502 errors people are reporting.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top