Web Hosting Manual & Guide

CHAPTER THREE - CGI-BIN SCRIPTS


3.1 Cgi-bin scripts

"Where do I put my cgi-bin scripts?"

Put them in the subdirectory cgi-bin which should be under your public_html directory. You may then call them thru a browser as http://www.yourdomain.com/cgi-bin/your.cgi

"I don't have a cgi-bin directory!"

Make it by typing mkdir cgi-bin while in your public_html directory.
You can use File Manager from the control panel to create/edit/delete files/directories and set permissions or your FTP client to create/delete files/directories and set permissions.

"How do I access cgi-bin scripts in the cgi-bin directory?"

If your domain name is bart.com, and the script itself is called your.cgi, access them as http://www.bart.com/cgi-bin/your.cgi.

"Hey! /cgi-bin/ doesn't work for me!"

Ask us to activate your cgi-bin directory.

3.2 Perl scripts

What is the correct path to perl(and other programs)?

"I am being told file not found"

"I am being told No such file or directory"
Upload your Perl script in ascii mode, not binary mode.
Use rz -a for telnet users, or the ascii mode for ftp users.
Sometimes it seems like this is asked about once a day, so we're going to repeat it, loudly.
Upload your Perl script in ascii mode, not binary mode. Use rz -a for telnet users, or the ascii mode for ftp users. 

"I get errors such as Literal @sdfsdf now requires backslash at ./test.rob line 2, within string Execution of ./test.rob aborted due to compilation errors."

Place a "\" before such offending @ characters. This is an incompatibility between Perl 5 and Perl 4.
Alternatively you could change the first line in your Perl program from
#! /usr/bin/perl
to
#! /usr/bin/perl4.
The correct path to perl is
/usr/local bin/perl OR
/usr/bin/perl.
Both usually lead to access to Perl, however, try changing it if your script is not working.
 © 2003-2019 Magic Scripts | Valid XHTML