First Time CGI setup errors

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
joseph_shields
-


Joined: 26 Apr 2004
Posts: 10

PostPosted: Tue Apr 27, 2004 4:39 pm    Post subject: First Time CGI setup errors Reply with quote

Hi, I am new to CGI and would appreciate the help as this has me stumped!

• I am trying to run a Perl (.pl) script on abyss version V1.2.2.2

• The script mentioned is the 'nms guestbook' from Matt's Script Archive.

• I have the script in the Abyss cgi-bin directory.

• I have the 3 guestbook html files in a sub directory of 'htdocs' called 'guestbook'.

• I have changed the 4 urls in the guestbook.pl file so it reflects my server address and file structure - see below

[i]$guestbookurl = 'http://220.50.112.20/guestbook/guestbook.html';
$guestbookreal = '/guestbook/guestbook.html';
$guestlog = '/guestbook/guestlog.html';
$cgiurl = 'http://220.50.112.20/cgi-bin/guestbook.pl';
[/i]

• Line 1 of the guestbbok.pl file reads as folows: #!/usr/bin/perl -w

• I have changed the urls in the 'addguest.html' file so they reflect the location and file structure ofmy server.

• I have installed Perl (not sure if it is correctly installed). The version I am using is 'ActivePerl-5.6.1.638'.

• I have setup the server as follows:
CGI INTERPRETERS
(Interpreter)C:\Perl\bin\perl.exe (Assc. Ext.)pl cgi
(Interpreter)/cgi-bin/guestbook.pl (Assc. Ext.)pl

CGI PATHS
(path)/*.pl
(path)/*.cgi
(path)/guestbook.pl

• I havent touched the mime types

• The error appears when I go to this page:
http://220.50.112.20/guestbook/addguest.html
I enter in some details and then it comes back with an error message:
'Application Error'
'An error has occured in the program'
The log file says the following:
open /guestbook/guestbook.html.lck: No such file or directory at guestbook.pl line 592.

I have looked at line 592 but i dont understand that part of the code.

Does anyone have any idea where I may be doing something wrong?

Thanks for any help in advance

Joe
Back to top View user's profile Send private message
Axis
-


Joined: 29 Sep 2003
Posts: 336

PostPosted: Tue Apr 27, 2004 10:25 pm    Post subject: Reply with quote

Hi Joe--

Firstly, I don't think you need the second CGI Interpreter you list:
(Interpreter)/cgi-bin/guestbook.pl (Assc. Ext.)pl

the above is not an interpreter but an path to a perl script. It looks like you have the "other" CGI Interpreter set up fine...that is:
(Interpreter)C:\Perl\bin\perl.exe (Assc. Ext.)pl cg

One problem may be the source code for your "addguest.html" which points to ' http://220.50.112.20/cgi-bin/guestbook.cgi ' instead of guesbook.pl

Please try the two above suggestions and let us know how it goes!
That is: delete the CGI Interpreter "(Interpreter)/cgi-bin/guestbook.pl (Assc. Ext.)pl"

and change the source code for addguest.html to " http://220.50.112.20/cgi-bin/guestbook.pl "

Regards,
Axis
Back to top View user's profile Send private message
Axis
-


Joined: 29 Sep 2003
Posts: 336

PostPosted: Tue Apr 27, 2004 10:39 pm    Post subject: Reply with quote

Hi again Joseph--

You could also change the settings in guestbook.cgi to reflect the correct extention instead of changing the source code of the addguest.html

You could try looking at this screenshot if it helps any:
http://sixa.no-ip.info/images/serverparameters.jpg
http://sixa.no-ip.info/images/cgiparameters.jpg

if that helps at all...

Also, looking further, you should try getting:
http://220.50.112.20/cgi-bin/hello.pl working to make sure perl is working before going on the the guestbook.

Don't give up...you're close!

Regards,
Axis
Back to top View user's profile Send private message
joseph_shields
-


Joined: 26 Apr 2004
Posts: 10

PostPosted: Wed Apr 28, 2004 4:03 am    Post subject: Reply with quote

Thanks for your help Axis.

From your first reply.
Quote:

Please try the two above suggestions and let us know how it goes!
That is: delete the CGI Interpreter "(Interpreter)/cgi-bin/guestbook.pl (Assc. Ext.)pl"

and change the source code for addguest.html to " http://220.50.112.20/cgi-bin/guestbook.pl "


I have these done these two changes. And its still not working. I am now getting a "Too late for "-T" option at guestbook.pl line 1." error in the cgilog file.
I was getting this error initially so I deleted the "-T" from line 1 of the guestbook.pl file and then the error mentioned in the initial post started happening.
"Application Error
An error has occurred in the program

open /guestbook/guestbook.html.lck: No such file or directory at guestbook.pl line 592.
"

I checked the Perl documentation and throught the command prompt have run a script and therefore have Perl set up correctly.

I found hello.pl from another post in the cgi forum, this was posted by someone from aprelium in response to another persons cgi problems.

I am trying to get this set up also. but its not working.

Any ideas about what to check next in the guestbook or hello.pl file?

Thanks
Joe
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Wed Apr 28, 2004 4:29 am    Post subject: Reply with quote

Also, delete the line "(path)/guestbook.pl" under CGI paths. Abyss looks for directories, not files.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
joseph_shields
-


Joined: 26 Apr 2004
Posts: 10

PostPosted: Wed Apr 28, 2004 4:37 am    Post subject: Reply with quote

I have deleted that reference in the cgi paths section. Still no luck.

I have a screenshot of my server CGI config page located at the following url:

http://220.50.112.20/cgisetup.gif

Thanks
Joe
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Wed Apr 28, 2004 4:51 am    Post subject: Reply with quote

Are you able to run other CGI scripts?
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
joseph_shields
-


Joined: 26 Apr 2004
Posts: 10

PostPosted: Wed Apr 28, 2004 4:57 am    Post subject: Reply with quote

No, I havent got it to work with any scripts so far.

I have tried the guestbook, a simple hello.pl file ( from a post in this forum) and a form.

I have had no luck so far. I have followed all the readme files and server setup so I'm a little stumped.

I am running XP pro, MS Internet Sharing and Zone Alarm Pro. Could Zone Alarm be causing a problem?

Thanks
Joe
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Wed Apr 28, 2004 5:00 am    Post subject: Reply with quote

Just try disabling it to be sure.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Axis
-


Joined: 29 Sep 2003
Posts: 336

PostPosted: Wed Apr 28, 2004 5:00 am    Post subject: Reply with quote

Hello again Joe--

Why I ask about the hello.pl is that it is returning a 500 error also. So that makes me wonder if everything with your perl installation and abyss configuration is right. (Forgive me for snooping your cgi-bin but I am just trying to help :-)

The application error from guestbook.pl is "open /guestbook/guestlog.html.lck: No such file or directory at guestbook.pl line 592"

You could open the guestbook.pl in notepad or your favorite editor and do a "goto" to find line 592 and check what is there.

Are you able to execute hello.pl?

also you should, I believe, remove the trailing slash from /cgi-bin/ to /cgi-bin in cgi-paths. I have my setting for "Resolve interpreter using the script's #! line" to "yes" but I am not sure if I need to do that...but I have perl working so all is good.

Keep at it...you are closer... :-)

Regards,
Axis
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Wed Apr 28, 2004 5:14 am    Post subject: Reply with quote

I would not suggest setting the "Resolve interpreter using script's #! line" to "yes." Too many people mess that up, and it can go wrong very easily. Just make sure you have Perl set up correctly (from your screen shot, it looked right), and all the directories pointing in the right place.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
joseph_shields
-


Joined: 26 Apr 2004
Posts: 10

PostPosted: Wed Apr 28, 2004 5:32 am    Post subject: Reply with quote

Quote:
The application error from guestbook.pl is "open /guestbook/guestlog.html.lck: No such file or directory at guestbook.pl line 592"

• You could open the guestbook.pl in notepad or your favorite editor and do a "goto" to find line 592 and check what is there.


As I mentioned in my first post I have looked at line 592 of guestbook.pl but I dont understand that part of the code. Here is what it says:
(Line 592-594)
my $lock = IO::File->new(">>$filename.lck") or die
"open $filename.lck: $!";
flock $lock, LOCK_EX or die "flock $filename: $!";

• hello.pl doesnt work. It returns a 500 error.

• I ran a test Perl script at the command prompt (one of the scripts that came with perl). So I know that it is working.

• I made a very simple perl script like the one mentioned at:
http://www.aprelium.com/forum/viewtopic.php?t=2808&highlight=hello+pl
In the script it simply says:
#! /bin/perl.exe

echo "Hello World..."

When I run this script from the command prompt it gives me this error.

String found where operator expected at hellotest.pl line 3, near "echo "Hello World...""
<Do you need to predeclare echo?>
syntax error at hellotest.pl line 3, near "echo "Hello World...""
Execution of hellotest.pl aborted due to compilation errors.

I tried to run this script on my webserver also but its giving the 500 error.

• With all my scripts not working it makes me think there is a setup error somewhere, either Perl, or Abyss.

I have followed the Aprelium steps to enable Perl on my server and can run a simple .pl script at the command prompt so it appears Perl is working.

I can think of where else I am going wrong. But I dont know CGI very well.. thats why I'm here!

Thanks for your help
Joe
[/b]
Back to top View user's profile Send private message
joseph_shields
-


Joined: 26 Apr 2004
Posts: 10

PostPosted: Wed Apr 28, 2004 6:25 am    Post subject: Reply with quote

I have checked my cgilog and after its all set up as mentioed above, this is the error I am getting:

Too late for "-T" option at guestbook.pl line 1.
String found where operator expected at hellotest.pl line 3, near "echo "Hello World...""
(Do you need to predeclare echo?)
syntax error at hellotest.pl line 3, near "echo "Hello World...""
Execution of hellotest.pl aborted due to compilation errors.

Any help appreciated this has really got me stumped.

Thanks
Joe
Back to top View user's profile Send private message
joseph_shields
-


Joined: 26 Apr 2004
Posts: 10

PostPosted: Wed Apr 28, 2004 6:29 am    Post subject: Reply with quote

I should mention that last post with the cgi log error messge in it was what I got from trying to run the simple hellotest.pl script

When I try to runthe guestbook as it gives me the 500 error.
Back to top View user's profile Send private message
joseph_shields
-


Joined: 26 Apr 2004
Posts: 10

PostPosted: Wed Apr 28, 2004 6:38 am    Post subject: Reply with quote

More info on the problem.

When I remove the -vT from line1 of my guestbook.pl script I get the following message.
( this is my original message)

Application Error
An error has occurred in the program

open /guestbook/guestbook.html.lck: No such file or directory at guestbook.pl line 592.

Joe
Back to top View user's profile Send private message
Axis
-


Joined: 29 Sep 2003
Posts: 336

PostPosted: Wed Apr 28, 2004 5:17 pm    Post subject: Reply with quote

Hi again Joe--

I pm'd you a simple hello.pl script to try. That will allow you to see if perl works on your abyss installation.

I commented that I had trouble with the NMS Guestbook, even when installed on an Apache Server...thought it might have been just me.

Are you using Windows 95-98 for your OS? If so this comment from Aprelium might be useful.

"Skidmark,
The only problem that Win95-98-ME has with some Perl scripts is related to the use of the flock() instruction. If your script uses this instruction, you may have some trouble" from:
http://www.aprelium.com/forum/viewtopic.php?t=4011&highlight=file+locking+flock

and further:
"flock instruction is available on UNIX systems only (This is a Perl limitation, not related to the web server.) On Windows systems, it has no meaning and should be ignored. Are you sure you downloaded a Windows compatible package of YaBB?" :
http://www.aprelium.com/forum/viewtopic.php?t=695&highlight=flock

I take this to mean that some scripts dependent on the flock command will not work well with windows. This may be part of the problem with your error:

"my $lock = IO::File->new(">>$filename.lck") or die
"open $filename.lck: $!";
flock $lock, LOCK_EX or die "flock $filename: $!";"

since this is calling a flock or file locking command.

If you get the hello.pl working I sent you, then I would try the MSA version of guestbook.

Regards,
Axis
Back to top View user's profile Send private message
joseph_shields
-


Joined: 26 Apr 2004
Posts: 10

PostPosted: Thu Apr 29, 2004 4:29 am    Post subject: Reply with quote

I'm using XP Pro.
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Apr 30, 2004 12:31 pm    Post subject: Re: First Time CGI setup errors Reply with quote

joseph_shields,

Please send to support@aprelium.com the original package of the script you're using (or an URL where we can find it) and your abyss.conf file. We'll check it and will see what's wrong.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
joseph_shields
-


Joined: 26 Apr 2004
Posts: 10

PostPosted: Fri Apr 30, 2004 4:41 pm    Post subject: Reply with quote

I managed to get the guestbook script working.

In the guestbook.pl file, I needed to put in the local filesystem address for two of the guestbook.html files. I previously had them in as the internet url!

only took me a week to figure out!

Thanks Axis and everyone else for all your help.

Joe
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group