DiscusWare, LLC.
Download Purchase Contact Us
Home
Support Home Documentation Knowledge Base Support Forums Support Request Advanced Services
When I access scripts, I see source code only

What to do if you see a plain text file, the first line of which is #!/usr/bin/perl (or similar), when you access ftpdiag.cgi, dconfig.cgi, or your Discus CGI scripts.
Support Site Search
 

This document assists you in resolving a problem whereby you attempt to access a CGI script on your server (generally ftpdiag.cgi for the FTP setup or dconfig.cgi for the shell setup) but all you see is the source code. It will look something like this (ftpdiag.cgi shown):

#!/usr/bin/perl
#<!--
# ------------------------------------------------------------------
# DISCUS FTP SETUP ASSISTANT SCRIPT
#
# Congratulations, if you are seeing this page, generation of this
# script was successful!
#
# Now, select "File | Save As..." from your browser's window.
# This output should be saved as "ftpdiag.cgi" in any temporary
# folder on your hard disk. When you have saved the file, use your
# browser's back button to return to the instructions. This file
# should be saved as plain text, NOT as HTML.

The explanation for this problem is that you have placed the script into a directory where the execution of CGI scripts is not enabled. Your server is also set up so that if it does not recognize the type of file, it sends it as plain text. Thus, instead of the script being treated as a script and being run by the server, it is simply transmitted to your browser as a plain text file.

This is not a problem with the script itself, but rather a problem with the configuration of your server. Your server is not executing CGI scripts in the directory where the file in question resides. Fortunately, there is often a way to work around this problem, as the problem generally occurs due to one of the following reasons:

  1. Script outside cgi-bin directory. Most servers are set up so as to allow the processing of scripts only in the "cgi-bin" directory of your site (and generally subdirectories thereof). If you have a cgi-bin directory (or similar place for your CGI scripts), try uploading the script to that directory and then accessing it again. Remember that when you upload a script, you MUST use ASCII mode, and set the permissions to 0755 (rwxr-xr-x).

    If you have difficulty uploading the script to your cgi-bin directory, please contact your web host. Note that there is nothing that DiscusWare can do to help you if you get error messages when uploading files.

  2. Script has the wrong extension. On some servers, files will be treated as scripts if they have a certain extension (like *.cgi) but will not be treated as scripts if they have another extension. If the extension *.cgi does not work, try the extension *.pl (rename the file using your FTP program and then try accessing it again through your web browser).

  3. You do not have CGI privileges. On some servers (especially free web hosts), users such as yourself are not permitted to run CGI scripts at all on the server. Examples of web hosts which (at the time of this writing) do NOT permit you to run CGI scripts are Tripod, Geocities, etc. If you have tried each of the above suggestions and still were unable to get the script to work properly, look through your web host's documentation to see if they have any information or FAQs on running CGI scripts. If you don't find anything, contact your web host and ask them.

    If your web host does not allow CGI scripts, you will not be able to run Discus (or any other program that uses CGI). You will need to switch to a web host that meets the Discus system requirements in order to run Discus.

We wish you the best as you seek to resolve this error. As this is a problem with server configuration, or with you putting the file in the wrong place as expected by your particular server, we regret that we will not be able to assist you further than providing the above general suggestions.


Download Purchase Contact Us
Privacy Policy
Copyright © 2005, DiscusWare, LLC, All Rights Reserved