View Full Version : cgi script
cupysmom
Apr 25th, 2001, 11:25 PM
I am new to cgi and can't get a survey script to work. I think I may have the a path to a file incorrect. How can I find a relative or absolute path?
Martie
Apr 26th, 2001, 12:03 AM
Hi cupsymom,
Welcome to the forums.
You didnt say what kind of error you are getting?
Its possible you may need to set permissions on script.
If those arent set properly, then scripts are not going to work:confused:
Do you have your own cgi-bin?
You might want to contact your host and see what they say.
akashik
Apr 26th, 2001, 02:59 AM
within the script the paths will be pretty easy to find (unless it's a huge script). Quite often there is a configuration file that will take care of everything once correctly filled out. Other than that paths are *usually* near the top of each file.
relative paths are just like html links and as long as the script is installed as way it was intended don't cause problems very often. Absolute paths on the other hand can be different depending on the server setup. On our servers for instance it is:
/home/username/domainname-www/cgi-bin
to the cgi-bin with the path to perl itself being:
#!/usr/local/bin/perl
In general they are just variations on those two lines of code. Verio for instance uses cgi-local instead of cgi-bin
If your host has a good online support area it should all be written in there somewhere. If not, just e-mail them regarding it.
Checking permissions is a good thing to do too. The install file for the script should spell out what each file should be set as.
Greg Moore
Jaiem
Apr 26th, 2001, 06:33 AM
Also make sure you have the script file set to the right permissions.
yourdomainhost
Apr 26th, 2001, 09:51 AM
Originally posted by cupysmom
I am new to cgi and can't get a survey script to work. I think I may have the a path to a file incorrect. How can I find a relative or absolute path?
If you have telnet access, you can telnet to your account, navigate to the directory that contains the file that you need the system path for, and type:
pwd
That will return the system path.
Also, you can find the correct path to Perl by typing the command:
whereis perl
You can also troubleshoot Perl scripts from the telnet command prompt. Navigate to the directory that contains your script, and type this command:
perl -w myscript.cgi
where myscript.cgi is the name of your script.
That will probably return a lot of gibberish, but it may also return an error message or two that helps you locate the problem.
If your script is returning an Internal Server Error, the ISE troubleshooter at http://www.hostingmanual.net/troubles/ise.shtml may help solve the problem. (I hope that doesn't constitute advertising.)
Good luck!
James
cupysmom
Apr 26th, 2001, 12:25 PM
Originally posted by cupysmom
I am new to cgi and can't get a survey script to work. I think I may have the a path to a file incorrect. How can I find a relative or absolute path?
The script I am trying to install is quick poll. When I try to access the administration panel for this script I get an error message that says "Cannot create a lock file". I check the path with your previous replies and am sure I have it correct. I also checked my permissions against the authors instructions and they seem to be correct. I'm at a loss... any more suggestions?
Mr Chunder
Apr 26th, 2001, 12:37 PM
I'm no expert at cgi but generally the message cannot create a lock file usually means that an app (cgi exe or control panel app) cannot write a lockfile in its chosen directory because of good old PERMISSIONS.
You have to find out which app it is, what user it runs under and which directory it is trying to write to. Then check that that user account has the necessary permissions to write to that directory.
Hope this helps a little, anyway :)
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.