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 (Setup.pl, YaBB.pl and AdminIndex.pl). Make sure you add it to the file you are currently trying to run, it doesn't make sense adding it to YaBB.pl if the problem occurs while running Setup.pl. 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:
| Code |  |
use CGI::Carp qw(fatalsToBrowser);
Note: in versions of YaBB newer than Y2.3.1, this is already in YaBB.pl, Setup.pl and AdminIndex.pl
| Code |  |
# 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 YaBB.pl, AdminIndex.pl and Setup.pl 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 Settings.pl!
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
Edit setup.pl
| Code |  |
# 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 YaBB.pl, AdminIndex.pl and Setup.pl.
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 Setup.pl) 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 Setup.pl ran fine, but YaBB.pl 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 (YaBB.pl, AdminIndex.pl, Setup.pl) 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