|
|
A little Perl and CGI problem with Apache
|
|
|
|
Senior User
Join Date: Sep 2007
Location: NY
Status:
Offline
|
|
I am currently in a Perl&CGI class at school and I am in need to run these scripts via Apache on my Macbook. I went through the following tutorials by O'Reilly, Part 1 , Part 2. Now when I write a simple cgi script:
Code:
#!/usr/bin/perl
print "Content-type: text/plain\n\nHet werkt!\n";
*Not all one line*
Then change it's permissions via terminal "chmod 755." I then go to my Macbooks URL and locate the file it just prints out the code. It should display "het werkt!" I am completely stumped as to what I am doing wrong. Everything seems to be connecting ok.
Any help would be greatly appreciated. Thanks in advance!
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status:
Offline
|
|
I assume that you are putting this in the document root? You have to put it in the cgi-bin (CGI-Executables locally) directory.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Sep 2007
Location: NY
Status:
Offline
|
|
Originally Posted by larkost
I assume that you are putting this in the document root? You have to put it in the cgi-bin (CGI-Executables locally) directory.
There was a spot in the second part that said if I uncomment the line:
Code:
# AddHandler cgi-script .cgi
in my httpd.conf file, I could run a CGI script from anywhere. But even when the script is in the CGI-Executables folder it still just displays the code instead of interpreting it. Thanks
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Just to check: The file is named <something>.cgi, right?
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Senior User
Join Date: Sep 2007
Location: NY
Status:
Offline
|
|
It's saying I do not have permission to open the file now, even after "chmod 755". Yes it is a .cgi extension. I also tried the .pl extension and it just writes the code out, instead of interpreting. Thanks!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|