BigNoseBird.Com- Small Logo
The 508 compliant Guide to 
       Big Nose Bird
Site Search Engine

Script Troubleshooting

- Bruce
Whether you are having problems with a script or are downloading one, please subscribe to the newsletter using the box down in the lower right margin of this page. This is the best way to keep you up to date on changes, fixes, and such. Past issues can be viewed on the Previous Issues Page

Due to time constraints, I am unable to provide support for the scripts.

I get a great deal of e-mails from people trying to get their first cgi-bin script up and running. I want to help you be successful, but you have to do some homework in terms of getting to know your server.

There are probably about fifty flavors of Unix with about eight different httpd servers. Any of these can be configured in an unlimited number of ways.

ATTENTION HYPERMART AND VIRTUALAVE USERS!!!

It appears that these two services do not support SMTP. Please modify your bnbform, virtual card, nomodomo, birdcast scripts to use the $SEND_MAIL variable. The instructions are in the scripts and README.TXT files.
Virtualave.net: $SEND_MAIL="/usr/sbin/sendmail -t";
Hypermart.net: $SEND_MAIL="/var/qmail/bin/qmail-inject";

ATTENTION NOMODOMO USERS!!!
There was a problem in the nmmdadmin.cgi module in that the e-mail address was not being seperated from the log information. Please download the script, or view line 304 to about 307 to see the fix.

BEFORE STARTING ON A SCRIPT OR LOOKING ANY FURTHER
READ THIS SECTION. IT HAS COMMON PROBLEMS ASSOCIATED
WITH MOST SCRIPTS!
  • First, find out from your system administrator if you are allowed to run cgi scripts on your server.

  • Second, find out where your cgi-bin directory is located.

  • Third, find out how to call a cgi-bin script, i.e., http://domain.com/cgi/yourname/cgi-bin/script.cgi or /cgi-bin/script.cgi as examples.

  • Fourth, make sure you know how to properly FTP files between your PC and unix server. Files ending with .txt, .cgi, .pl, .html must be sent as type ASCII. Files such as .jpg, .mid, .gif must be sent as type BINARY.

  • Fifth, ask where PERL is located on the server. Popular locations are /usr/local/bin/perl, /usr/bin/perl, and /usr/sbin/perl make sure it is the right perl! Some systems have more than one version of perl installed. Go for Version 5.

  • Sixth, if the script uses e-mail, such as Virtual Cards, BNBFORM, BNBBOOK, or BIRDCAST, make sure you have the sendmail program correct or that SMTP is set correctly. In the scripts, it is /usr/lib/sendmail -t
    If you must change it to /usr/sbin/sendmail or some other location, be sure to have the -t option on the command line. Making the mistake of removing the -t is a sure way to kill any of these scripts!

DID YOU READ THE README.TXT FILE????
There is a file README.TXT included with all BNB scripts with the exception of the whois script. It pretty much covers all of the possible problems and gives solutions. I would have to say that over 95% of the help mail I get is covered by the README.TXT!!! If you don't hear back from me, well.... Please understand that this site is not our living, and that we only have a few hours a week that can be dedicated to handling e-mail.

Just under this paragraph you will see two versions of a very small, but telling script called diag.cgi that can tell me everything I need to know to help you out. If your PERL is in /usr/local/bin, use #1. If it is in /usr/bin, the use #2. If it is elsewhere, you will have to make a minor change to either script.


Test Script Version #1: Assumes perl is in /usr/local/bin

#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
foreach $item (keys %ENV)
{ print "$item = $ENV{$item}<BR> \n"; }
$rundir=`pwd`;
print "Working Directory is: $rundir<BR>";


Test Script Version #2: Assumes perl is in /usr/bin

#!/usr/bin/perl
print "Content-type: text/html\n\n";
foreach $item (keys %ENV)
{ print "$item = $ENV{$item}<BR> \n"; }
$rundir=`pwd`;
print "Working Directory is: $rundir<BR>";

  • STEP 1: Highlight and copy the proper script above to your favorite editor.

  • STEP 2: Made certain that the line with #!/usr/local/bin/perl (or whatever your perl is) is the first line with NO LINES above it, or spaces before it.

  • STEP 3: If your path to perl is different, then edit the first line so it is correct. Be sure to leave the #!/ beginning alone.

  • STEP 4: Save the file as diag.cgi

  • STEP 5: Using FTP, transfer the file to what you belive to be your cgi-bin directory. Make certain that you use ASCII mode, and NOT binary.

  • STEP 6: Using the Unix Permissions function of your FTP program, set the permission on diag.cgi to 755. This means that the owner can read-write-execute, group can read-execute and all others can read-execute.

  • Step 7: Attempt to run the script from your browser. To do this, you must know how to call a cgi-bin script.
If it runs, you have successfuly installed and executed a cgi script.

For a demonstration

FILES NOT BEING CREATED AUTOMATICALLY

On some servers, the cgi-bin scripts do not run as your user id, but as a special user that is typically called noone or nobody. If your scripts are not automatically creating files that they should, make a directory in your main html directory as shown below:

cd public_html (or whatever it is called on your system)
mkdir files
chmod 777 files

FTP users, issue the above commands via ftp. 777 means all permissions for everyone!

If you are using the survey.cgi script, you will see a line in it that reads
$DATA_PATH="/";

Change it to read

$BASEDIR="$ENV{DOCUMENT_ROOT}/files/";

For the bnbform.cgi script, you will have to set your outputfile variable to the full system pathname, such as
/usr/local/etc/httpd/public_html/files/filename.dat
Again, pay close attention to how your directories are named.

THE VIRTUAL CARD SCRIPT

98% of the problems people seem to have with installing this script are as follows:

  • $BASEDIR is set wrong. It must be a FULL UNIX PATH, NOT A URL! in otherwords it should look something like /usr/httpd/bruce/html/cards

  • Permissions are wrong on the cards directory. Not all servers run scripts as you. If the card is not being created, the chmod 777 the cards directory.

  • An oldie but goodie- you MUST put a \ backslash before the domain name of any hard-code e-mail address you might place in the script. "bruce@here.com" will not work. "bruce\@here.com" will!

THE BNBBOOK GUESTBOOK SCRIPT

The BNBOOK is a rather simple script, but here are the most common problems with setting up BNBOOK that usually result in the script not working:

  • The $GUESTBOOK variable is not set to the FULL UNIX PATH, NOT A URL. It should be something like /usr/httpd/bruce/html/gbook.html

  • You either removed the line <!--bookmark--> or it is not on a line by itself. It must be placed at the end of the top part of the guestbook that does not change, or in otherwords, where the next submitter's entry is to go.

  • An oldie but goodie- you MUST put a \ backslash before the domain name of your $MY_EMAIL. $MY_EMAIL="bruce@here.com" will not work. $MY_EMAIL="bruce\@here.com" will!
A GREAT RESOURCE!
Having CGI/Perl Problems? Need an answer? Check out ALL EXPERTS. They have volunteers on call to answer your questions for free.



Find or Give Help on the BBS
 
Home Top E-Mail
If it looks great, it's by Christine
Some Fine Print
© 1997-2003 BigNoseBird.Com®, Inc. All rights reserved. All other trademarks are the sole property of their respective owners. The products that we recommend are only ones that we use. We have no relationship with any of the authors or their companies. We cannot assume responsibility for their ultimate performance or lack of same. We also cannot assume responsibility for either any programs provided here, or for any advice that is given since we have no control over what happens after our code or words leave this site. Always use prudent judgment in implementing any program- and always make a backup first! For further information, please read our Privacy Statement. We can be contacted at webmaster@bignosebird.com.


<reallybig.com>
Web Builder Network Portal
Advertise
on the
Reallybig.com
Network
BigNoseBird Newsletter
Subscribe
Un-Subscribe


Sign up today to receive our low volume newsletter. Tips, tricks, news, and whatever else crosses our minds.
Back Issues
Privacy Statement