Gossamer Forum
Home : Products : DBMan : Installation :

CGI Error

Quote Reply
CGI Error
Very new to CGI, but learning. When I hit my http://www.flash.net/~murgnam/cgi-bin/dbman/db.cgi I get the following:

CGI ERROR
==========================================
Error Message : Error loading required libraries.
Check that they exist, permissions are set correctly and that they compile.
Reason: Can't find string terminator '"' anywhere before EOF at default.cfg line 149.

Script Location : /home/m/u/murgnam/www/cgi-bin/dbman/db.cgi
Perl Version : 5.00404
Setup File : default.cfg

Form Variables
-------------------------------------------

Environment Variables
-------------------------------------------
DOCUMENT_ROOT : /usr/local/etc/httpd/htdocs/
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : www.flash.net
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)
PATH : /usr/sbin:/usr/bin
QUERY_STRING :
REMOTE_ADDR : 216.215.40.149
REMOTE_HOST : 216-215-40-149.flash.net
REMOTE_PORT : 1358
REQUEST_METHOD : GET
REQUEST_URI : /~murgnam/cgi-bin/dbman/db.cgi
SCRIPT_FILENAME : /home/m/u/murgnam/www/cgi-bin/dbman/db.cgi
SCRIPT_NAME : /~murgnam/cgi-bin/dbman/db.cgi
SERVER_ADMIN : webmaster@flash.net
SERVER_NAME : www.flash.net
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : Apache/1.2.4 mod_perl/1.00
TZ : US/Central

Hoping it's something as simple as the " it "says" I'm missing ... but what do you think?

BTW: I saw another ref to CGIWRAP, which I also have to use on FlashNet. Any help would be appreciated. Thx.
Quote Reply
Re: CGI Error In reply to
Please save your default.cfg as a text file, such as default.txt and upload it to a publicly accessible directory where we can access it. Then post the URL where we can find the file.

You have a syntax error in your default.cfg file, which is causing the CGI Error. We need to look at the file to identify the problem.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: CGI Error In reply to
Uploaded default.txt to http://www.flash.net/~murgnam/default.txt
I found the " I was missing last night, but now I get "Illegal division by zero at default.cfg line 67"
Buddy of mine was thinking it might be the db.cgi file ... or is it, in-fact, the default.cfg file?
Quote Reply
Re: CGI Error In reply to
What is the exact error message you are receiving now?

Your default.cfg file looks fine. Try adding in the full absolute path to your DBMAN directory in the db.cgi file, like the following:

Code:
$db_script_path = "/path/to/~murgnam/cgi-bin/dbman";

Change the /path/to/ to your correct server path. Make sure that you do NOT include the trailing slash /.

If that doesn't work, then please post your db.cgi file as a text file.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited September 07, 1999).]
Quote Reply
Re: CGI Error In reply to
Maybe I'm calling it wrong, :-0.

If I go to http://www.flash.net/cgi-bin/cgiwrap/murgnam/dbman/db.cgi I get:

CGI ERROR
==========================================
Error Message : Error loading required libraries.
Check that they exist, permissions are set correctly and that they compile.
Reason: Can't locate default.cfg in @INC (@INC contains: http://www.flash.net/cgi-bin/cgiwrap/murgnam/dbman /usr/local/lib/perl5/sun4-solaris/5.00404 /usr/local/lib/perl5 /usr/local/lib/perl5/site_perl/sun4-solaris /usr/local/lib/perl5/site_perl .) at /home/m/u/murgnam/www/cgi-bin/dbman/db.cgi line 51.

Script Location : /home/m/u/murgnam/www/cgi-bin/dbman/db.cgi
Perl Version : 5.00404
Setup File : default.cfg

Form Variables
-------------------------------------------

Environment Variables
-------------------------------------------
DOCUMENT_ROOT : /usr/local/etc/httpd/htdocs/
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : www.flash.net
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)
PATH : /usr/sbin:/usr/bin
PATH_INFO :
PATH_TRANSLATED : /home/m/u/murgnam/www/cgi-bin/dbman/db.cgi
QUERY_STRING :
REMOTE_ADDR : 209.30.245.194
REMOTE_HOST : 209.30.245.194
REMOTE_PORT : 1295
REQUEST_METHOD : GET
REQUEST_URI : /cgi-bin/cgiwrap/murgnam/dbman/db.cgi
SCRIPT_FILENAME : /usr/local/etc/httpd/cgi-bin/cgiwrap
SCRIPT_NAME : /cgi-bin/cgiwrap/murgnam/dbman/db.cgi
SERVER_ADMIN : webmaster@flash.net
SERVER_NAME : www.flash.net
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : Apache/1.2.4 mod_perl/1.00
TZ : US/Central

If I go to http://www.flash.net/~murgnam/cgi-bin/dbman/db.cgi I get

CGI ERROR
==========================================
Error Message : Error loading required libraries.
Check that they exist, permissions are set correctly and that they compile.
Reason: Illegal division by zero at default.cfg line 67.

Script Location : /home/m/u/murgnam/www/cgi-bin/dbman/db.cgi
Perl Version : 5.00404
Setup File : default.cfg

Form Variables
-------------------------------------------

Environment Variables
-------------------------------------------
DOCUMENT_ROOT : /usr/local/etc/httpd/htdocs/
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : www.flash.net
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)
PATH : /usr/sbin:/usr/bin
QUERY_STRING :
REMOTE_ADDR : 209.30.245.194
REMOTE_HOST : 209-30-245-194.flash.net
REMOTE_PORT : 1300
REQUEST_METHOD : GET
REQUEST_URI : /~murgnam/cgi-bin/dbman/db.cgi
SCRIPT_FILENAME : /home/m/u/murgnam/www/cgi-bin/dbman/db.cgi
SCRIPT_NAME : /~murgnam/cgi-bin/dbman/db.cgi
SERVER_ADMIN : webmaster@flash.net
SERVER_NAME : www.flash.net
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : Apache/1.2.4 mod_perl/1.00
TZ : US/Central

If I go to http://www.flash.net/~murgnam/dbman/ I get

Restricted Access

I put in the full path (least I think I did it right), deleted what I had from the server, uploaded again (ASCII) and chmod ... I'm confused as !@#$. default.txt and db.txt are at http://www.flash.net/~murgnam/
Quote Reply
Re: CGI Error In reply to
Nope. Smile You do not have the correct path in the db.cgi file.

You do not include the http:// and domain. You should use the following:

Code:
/home/m/u/murgnam/www/cgi-bin/dbman

Everything else looks kosher.

Regards,


------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited September 07, 1999).]
Quote Reply
Re: CGI Error In reply to
Still no go, :-(

I've posted my latest modications and uploaded as db.txt and default.txt @ http://www.flash.net/~murgnam/

I found a CGI Tutorial @ FlashNet that tells me /cgi-bin/cgiwrap/username/filename.cgi is the way to go.

That said, when I enter http://www.flash.net/cgi-bin/cgiwrap/murgnam/dbman/db.cgi I get the following:

CGI ERROR
==========================================
Error Message : Error loading required libraries.
Check that they exist, permissions are set correctly and that they compile.
Reason: Illegal division by zero at /home/m/u/murgnam/www/cgi-bin/dbman/default.cfg line 67.

Script Location : /home/m/u/murgnam/www/cgi-bin/dbman/db.cgi
Perl Version : 5.00404
Setup File : default.cfg

Form Variables
-------------------------------------------

Environment Variables
-------------------------------------------
DOCUMENT_ROOT : /usr/local/etc/httpd/htdocs/
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : www.flash.net
HTTP_USER_AGENT : Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)
PATH : /usr/sbin:/usr/bin
PATH_INFO :
PATH_TRANSLATED : /home/m/u/murgnam/www/cgi-bin/dbman/db.cgi
QUERY_STRING :
REMOTE_ADDR : 209.30.240.228
REMOTE_HOST : 209.30.240.228
REMOTE_PORT : 1190
REQUEST_METHOD : GET
REQUEST_URI : /cgi-bin/cgiwrap/murgnam/dbman/db.cgi
SCRIPT_FILENAME : /usr/local/etc/httpd/cgi-bin/cgiwrap
SCRIPT_NAME : /cgi-bin/cgiwrap/murgnam/dbman/db.cgi
SERVER_ADMIN : webmaster@flash.net
SERVER_NAME : www.flash.net
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.1
SERVER_SOFTWARE : Apache/1.2.4 mod_perl/1.00
TZ : US/Central

I REALLY appreciate the help you've given me so far, pretty sure I understand division, but this has got me stumped, *sigh*

One last request for help? Or should I get with FlashNet directly?

Thx.
Quote Reply
Re: CGI Error In reply to
Hmmm...this is odd. You can try your ISP, but most ISP's answers to cgi problems is

"It is something in your script. Contact the vendor or author of the script."

Smile

Also, some ISPs do not have compentent perl programmers who know the difference between setting absolute and relative directory paths in perl and cgi scripts.

Smile

Okay, you are confused.

In the default.cfg file, use the following code for the $db_dir_url variable:

Code:
http://www.flash.net/cgi-bin/cgiwrap/murgnam/dbman

WITH NO TRAILING SLASH.

In your db.cgi, for the $db_script_path variable, use this code:

Code:
/home/m/u/murgnam/www/cgi-bin/dbman

OR

Code:
/cgi-bin/cgiwrap/murgnam/dbman

Hope this works this time.

*crosses fingers*

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: CGI Error In reply to
*Sigh*, those suggestion's don't work either. Awaiting reply from FlashNet ... then there's the option of changing ISP's, :-0.
Quote Reply
Re: CGI Error In reply to
BTW: What are the permissions of your files?

Please list them with their designated file permissions.

That is the only other problem I can think of.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: CGI Error In reply to
drwxr-xr-x 3 murgnam DIALIN 4096 Sep 7 20:10 .
drwxr-xr-x 3 murgnam DIALIN 4096 Sep 6 19:58 ..
drwxrwxrwx 2 murgnam DIALIN 4096 Sep 7 18:34 auth
-rw-r--r-- 1 murgnam DIALIN 6606 Sep 7 18:38 auth.pl
-rwxr-xr-x 1 murgnam DIALIN 45899 Sep 9 02:26 db.cgi
-rw-r--r-- 1 murgnam DIALIN 7444 Sep 9 02:18 default.cfg
-rw-rw-rw- 1 murgnam DIALIN 2 Sep 7 18:37 default.count
-rw-rw-rw- 1 murgnam DIALIN 6693 Sep 7 18:37 default.db
-rw-rw-rw- 1 murgnam DIALIN 62 Sep 7 18:37 default.log
-rw-rw-rw- 1 murgnam DIALIN 143 Sep 7 18:37 default.pass
-rw-r--r-- 1 murgnam DIALIN 43717 Sep 7 18:37 html.pl
-rw-r--r-- 1 murgnam DIALIN 18 Sep 7 20:10 index.html
Quote Reply
Re: CGI Error In reply to
Hmm....

Well, your permissions are set correctly. Have you heard from your ISP yet?

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: CGI Error In reply to
Nothing from FlashNet yet ... go figure! But, again trying my own resources I found the following statement on FlashNet's CGI Guidelines:

"At this time no compiled CGI
scripts are allowed on the server. There are several security issues that
arise from allowing compiled scripts to run on the server which is why we do
not allow them at this time."

Does that lead to the error of "Check that they exist, permissions are set correctly and that they COMPILE???" And is there any value in their statement that there are several security issues that arise from allowing COMPILED scripts?

Over

Quote Reply
Re: CGI Error In reply to
Would the below help my endeavors any?

- Several people have complained about permission denied for users when adding a page with a program, such as the WWWBoard, if you encounter this add a line like
chmod(0777,'$pathtodirectory$filename');

right after the file is created...
It will fix the rights right then and there.....
Quote Reply
Re: CGI Error In reply to
No, that really does not help. The permissions you've set-up are the correct default permissions for DBMAN files.

One thing I would recommend is to change the extension of your db.cgi file to db.pl. Keep the same permissions (755) for the db.pl file. Also, change the variables in the default.cfg to point to the db.pl file.

Let's see if that works.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: CGI Error In reply to
VOILA!!! ... of sorts, :-0. Changing to .pl AND changing my email address in the html.pl to include the \ -v- / gets me to the LOGIN screen, woohoo!

But ... 404 error when I try to test out with the admin/admin. Do I need to put in the absolute/relative URL of the db.pl in my default.cfg?

Ex. Login - http://www.flash.net/cgi-bin/cgiwrap/murgnam/dbman/db.pl
Admin/Admin I get - http://www.flash.net/home/m/u/murgnam/www/cgi-bin/dbman/db.pl

I'm learnin', :-). Give me another year and I'll be on yr staff, <g>
Quote Reply
Re: CGI Error In reply to
I am assuming you figured it out. But you also need to change the path to all your files, if you have changed directories.

But, I am glad that you figured it out.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: CGI Error In reply to
Eliot,

1. Aye, "somewhat" got the "basics" figured out now. Changed the default.cfg @ $db_dir_url to "/cgi-bin/cgiwrap/murgnam/dbman and got past the Login screen -- other files fine.

2. Spent about 3 hrs racking my brain on the &getdate, but alas JPD was right, "watch" the apostrophe's/syntax.

3. Been browsing thru the mod's, got my hyperlinks working, :-).

4. Presently at JPD's Tutorial -- what a wealth of knowledge.

5. Gonna kill some brain cells *gulp* this coming week and see how much more I can do/damage -- will make sure to include my link to the on-line sites when the time is right.

Very much thanks to you, JPD and most importantly Alex for developing this, :-)

JR