Page Index Toggle Pages: 1 Print
500 Internal Server Error (Read 261 times)
Captain John

500 Internal Server Error
Sep 25th, 2007 at 2:50am
Print Post  
How Do I Get More Specific 500 Errors?

This trick causes the web server do display more information about why a 500 error occured. Note that some servers do not support this technique, so it is not guaranteed to work, but it work do work on most servers. Note that if it didn't work, you'll need to remove the code again immediately, because if the server is missing the module requiered for this to work, this line will cause a 500 error all by itself, blocking other troubleshooting attempts. This trick can be added to any of your exacutable YaBB files (, and Make sure you add it to the file you are currently trying to run, it doesn't make sense adding it to if the problem occurs while running All you have to do is to add the code below to the top of the file in question, right below the path to perl line:

Select All
use CGI::Carp qw(fatalsToBrowser); 

Note: in versions of YaBB newer than Y2.3.1, this is already in, and
Select All
# use CGI::Carp qw(fatalsToBrowser); # used only for tests 

Simply remove the "#" to enable it

Note that it is vital that you type this line absolutely correct when adding it to your file. This line is perl code, which mean it is case and syntax sensitive. Any mistake, and the line will generate a 500-error all of its own, instead of helping you resolve existing ones. Also note that this line relies on a server module that not all server has (Most though). If adding this doesn't seem to make any difference for you, please remove this line again, to avoid the possibility of this line causing an error in itself...

Why Am I Getting A 500 Error?

Check the following:

   * Did you upload the scripts in ASCII?

Note that if you didn't upload the files at all (By downloading directly to the server), or you uploaded the zip file to the server and unzipped it locally there, you either need to make sure that you unzip it with the correct parameters, or you will end up with DOS-style linebreaks on the files. The correct parameters will vary between utilities, so check the manual for yours. An alternative way is to run a utility called dos2unix on the files after extracting, as this will convert them. Note that this issue is only related to unix/linux servers.

   * Did you set CHMods correct? (Most importantly, the, and files, and the 'yabb2' directory must all be CHMOD 755. Enything else, including 777, as a high probability of causing a 500 error)
   * Did you set Perl-path correct? (in first line of your script i.e. "#!/usr/bin/perl")
   * Did you use the right paths?
   * Does your server support Perl scripts ?
   * Check the values in your! The "$use_flock" setting is especially important. Set it to 1 for a server running on Unix/Linux, Macintosh or WinNT platforms. Set it to 2 for a server running on a Windows 95, 98, or M.E. platform.
    * Is your Perl version lower than 5.6?
The 'our' function is available only since Perl v5.6.0
Select All
 # If your Perl version is lower, then comment the 'our'-lines out and use this:
# use vars qw(@categoryorder,@catboards,@catdata,@boarddata,@allboards,%catinfo,%cat,%board,%boarddata,$catfile,$boardfile,$key,$value,$cnt);
our (@categoryorder, @catboards, @catdata, @boarddata, @allboards);
our (%catinfo, %cat, %board, %boarddata);
our ($catfile, $boardfile, $key, $value, $cnt);
our (%fixed_users); 

Remember that each of the steps above can generate a 500-error on it's own, so it is important to make sure everything is correct at the same time.

If you have checked all of the above and you are still getting a 500 ISE error, try adding "--" (without quotes) after your path to perl in, and

If you STILL get a 500 error, it's one of the following:

   * Incorrect path to Perl (also known as shebang)
   * Incorrect file permissions (chmodding)
   * Incorrect format when uploading (ASCII/Binary)
   * Incorrect filename or path when calling the script
   * Inability to run perl scripts (Not allowed at all, not allowed in this directory, etc)

If you still get a 500-error, and no more information after adding this line, it is usually one of the reasons given below. Note that if your script is already running, but the 500-error occurs somewhere in the middle (Like in the middle of the converter process of only the first two items in the list is valid, and you can ignore the rest. If the script doesn't run at all, all items are valid. Remember to differensiate between the files. If ran fine, but never started, most items in the list could be the potential problem.

   * The server doesn't support the module required. Remove the code immediately
   * The CHMOD's are not correct. Make sure the file in question is CHMOD 755, and the directory it resides in are 755 as well. Your host may have some special restrictions when it comes to CHMODs as well, especially the one for the three executable files and the 'yabb2' directory itself.
   * The path to perl line isn't correct. Make sure it begins with the #!-characters (No matter what info your host has given you. Many gives you just the path, and those two characters are not part of the path, just vital identifiers in a script file), and that the path that follows is 100% correct. Alo, do NOT add any switches at the end of this line, like -w, -T or the like. The only one that should appear at the end is the -- one that is in there by default. (Again, ignore what your host says about this matter. Many lists -w at the end of the path to perl for some reason)
   * File was uploaded in Binary mode instead of ASCII mode. Reupload the file in forced ASCII mode (Avoid the Auto/Smart mode of your FTP client). If you have command line access to the server(Console, SHH, Telnet), and it is a unix/linux box, you can also run dos2unix on the file, but remember to CHMOD it again afterwards if you do.
   * You are not allowed to run cgi scripts, either at all, in this directory, or with this extension. Check with your host if you are allowed to run cgi-scripts, and exactly where on the server you need to place these. You can also try renaming the three executable files (,, from .pl to .cgi (YaBB.cgi, AdminIndex.cgi, Setup.cgi). Make sure you rename all three of them if you do, and do NOT rename any of the other .pl files in the package.

edited by JonB - 2009-01-02 to include 'our' info
« Last Edit: Jan 2nd, 2010 at 6:12pm by »  
Back to top
IP Logged
Captain John

Re: 500 Internal Server Error
Reply #1 - Dec 8th, 2008 at 5:47pm
Print Post  
Y2.3 500 ISE when Posting ...

If your getting ...
[Sun Oct 19 17:31:46 2008] Can't continue after import errors at Modules/Upload/ line 27
[Sun Oct 19 17:31:46 2008] BEGIN failed--compilation aborted at Modules/Upload/ line 27.

type errors .. it is usually because your Host Server has not updated the Perl Modules ...

ebcdic2ascii is an Apache-specific function which is available only on EBCDIC based operating systems (OS/390, BS2000). It translates the EBCDIC encoded string ebcdic_str to its equivalent ASCII representation (binary safe), and returns the result.

ascii2ebcdic is the inverse of ebcdic2ascii.

A Work around is to, If it makes problems remove it. I think everything will work as intended anyway.

change line 27 from...

Select All
use CGI::Util qw(rearrange make_attributes unescape escape expires ebcdic2ascii ascii2ebcdic); 


Select All
use CGI::Util qw(rearrange make_attributes unescape escape expires); 

i.e. remove "ebcdic2ascii" and "ascii2ebcdic" from line 27 in Modules/Upload/
Back to top
IP Logged
Captain John

Re: 500 Internal Server Error
Reply #2 - Nov 10th, 2010 at 5:48pm
Print Post  
Additional troubleshooting ..........

Perl by default is very forgiving. In order to make it more robust it is recommended to start YaBB & program with the following lines:

   1. #!/usr/bin/perl
   2. use strict;
   3. use warnings;

The two additional lines request from perl to catch various common problems in your code. They check different things so you need both. A potential problem caught by use strict; will cause your code to stop immediately when it is encountered, while use warnings; will merely give a warning (like the command-line switch -w) and let your code run.
Back to top
IP Logged
Page Index Toggle Pages: 1
  « Board Index ‹ Board  ^Top