osx - Why does my Perl CGI script showing up as plain text in the browser? -
I'm playing with making my Mac a webserver, and now I'm trying to create a simple HTML form, And a Perl script that prints inputs is symlinked to me / library / webserver / documents ~ / sites, so I have both index.html and display.cgi. But when I submit the submit, So perl file just appears as text me CG The file is not executed, it appears as a text only. What am I doing wrong? Thank you
Unless your server specifically / library / webserver / document
folder, you have to put them in the / library / WebServer / CGI-Executables
. (And then access them in the URL with the / cgi-bin /
path, such as http: //localhost/cgi-bin/display.cgi
.)
Once you do this, make sure that you have set permissions on the Perl script so that it is executable. To do this, go to the directory containing the terminal and type chmod a + x display.cgi
.
Also, check that the correct path for Pearl in the first line of the script ( Shebang line ) is on my Mac, Perl / usr / bin / perl < / Code>, but if you want to check for yourself, run
command which perl
.
Comments
Post a Comment