Problem with "Cgi-script"

macfreak88

Bring me Tiger!
Hi!,
I have download a script wich enables you to make a mail form on your homepage when i had set the options for it i says:

Save this file and upload in ASCII mode to your /cgi-bin/ directory

CHMOD to 755

how can i do this and how will it work?...If i want to have this on my webhotels server what should i do and if i want to use it from my computer via websharing ...please help me!:confused:

And another question i have heard that its excists a guestbook cgi-script can any email me one with instructions.?
//Mårten
 
to CHMOD to 755 do this:

Code:
% chmod 755 [I]filename[/I]

i believe the cgi directory is /Library/Sites/CGI, or something like that. i can check when i go home, but it s easy to find.

all cgi scripts must be in this directory to be executed.

perl is quite powerful for writing cgi scripts, and it would make writing a guestbook quite easy. perhaps i will post a few instructions to get you started.
 
I like python too...

Mostly for the readability. However, Python does not come already installed.:mad:
Since Perl comes installed, you can "Plug and Play", to borrow a term.:D

Perl is not much more difficult to learn either. Just check google and you will find quite a few online tutorials to get you started.

The actual path to the cgi-bin is /Library/Webserver/CGI-Executables. Remember that the web location in the browser to the cgi needs to be:

http://www.whateveryourdomain.com/cgi-bin/cgi_program

Very important to remember the "cgi-bin" part and you will also have to enable the cgi-bin in Apache. One cool thing here is that if you want to move your cgi-bin to another Volume (so that it is not located on your root volume) you can link the new path in Apache and restart. Voila, your new cgi-bin directory is wherever you want.

Good Luck,
SA
 
But if i have and adress say: www.macfreak.com and i have to put an "cgi-bin" name after that and THEN put the name of the cgi-script but do i only have to write that directory or do i have to make one of my own ...and what should i write if i have it on my webserver (filesharing) then the adress is http://.ip.adress.here/cgi-bin/scriptname or have i made something wrong because erlier i started a websharing so can i make it on my computer?...// Mårten
 
I had the link to the script lie this:
http://my.ip.adress/cgi-bin/scriptname.cgi but it didn´t work:confused: and i tried without the ip adress and the same thing happens!!!...and a erlier post on this page said something about chmodd 755 or something what should i do to make it work...Look im not an professional.And i dont know anyrthing about .cgi only html and javascript
 
form method="post" action="/cgi-bin/eforms.cgi" and this is without the qouts

and it should work but something is wrong
 
what does the code snippet look like? i didn t understand your last two posts...

"it didn t work" is not very descriptive. tell us what error message you got please.

you have to change the file permissions to executable. do this in terminal.app so:
Code:
% chmod 755 [I]/Library/WebServer/CGI-Executable/script.pl[/I]

if the script is not executable, then it will not execute.

Edit: i see you changed your posts to include an error message, and you fixed your code snippet. thanks.
 
ths is came when i tried to post the emailform with the cgi script:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

and what is a executable script? the error is version 500// Mårten and the script doesn´t en with a .pl it ends with a .cgi:confused:
 
it does not matter whether the file ends in .pl or .cgi

please read this thread carefully. there are three posts here telling you how to make a script executable. if the script is not executable, IT CANNOT EXECUTE.

tell us what happens if you type
Code:
% ls -l /Library/WebServer/CGI-Executables/eforms.cgi
 
[www:~] mrtenced% ls -l /Library/WebServer/CGI-Executables/eforms.cgi
-rwxr-xr-x 1 mrtenced staff 8944 May 4 14:00 /Library/WebServer/CGI-Executables/eforms.cgi
 
OK, the x indicates that it is in fact executable. this is good.

how about if you type this:
Code:
% /Library/WebServer/CGI-Executables/eforms.cgi

the script should execute if you type this, and give you back some html. this might not work if the script is expecting some parameters, but lets give it a try...

perhaps you could post the script here if it s not too long?
 
one more thing: OSX includes a perl script in your cgi bin, for debugging purposes. lets see if that works, so we can rule out any problems with apache or anything like that.

Code:
% chmod 755 /Library/WebServer/CGI-Executables/printenv

then in your web browser, and go to http://localhost/cgi-bin/printenv, and just briefly describe what shows up there.
 
it says unknown command because it is no command...what i think ok i´ll post the script...If you didn´t know its an email script
 
umm... are you responding to my earlier post, about executing the script, or to the later post about the printenv script. which one was not found?
 
It was the execute thing but the same thing happens on the printenv...you can download the script in .txt format and read it...
 
Back
Top