Even after testing a script offline using the internal or an external server, you may still get a 500 error after running on the remote host. This can be caused from a number of reasons:


  • The shebang (the first line of your script) is not correct. You may need to check where the path to perl is located.
  • Modules used in the script. Many web service providers don't have all the modules found under \perl\lib and \perl\site\lib installed. If this happens and the module is written only in perl, perhaps you can upload the module yourself in your cgi-bin folder recreating the folder it resides relative to your script. If not, you will need to ask the provider to install the module.


For example MIME::Lite in \perl\site\lib\MIME can be uploaded to your cgi-bin folder, by creating /cgi-bin/MIME/ and uploading there \perl\site\lib\MIME\Lite.pm


Other issues if you are uploading with a third-party program, or the extensions used for scripts are not common (pl plx pm cgi etc.)


  • Windows line endings. If you uploaded the file with windows line endings with a binary mode, probably it will not work. From the project manager, check if the transfer is "Text". If uploading via "Save to remote location", and the filename is not pl,plx,cgi,pm then modify the file DefaultModes.xml in OptiPerl's installation folder.


  • File and folder permissions. Make sure that the script was uploaded with a permission of 755, and the folders containing it have 755 permissions. The default permissions are set in the DefaultModes.xml file.


Still not fixed?


If the problem still persists and it is not a fault of the above, then make sure you add the next line in your script:


use CGI::Carp qw(fatalsToBrowser);


This will provide a detailed explanation about the error.



Top  Previous  Next