in reply to Re^2: To Run perl through CGI
in thread To Run perl through CGI
Your test script cannot run because it is not a cgi script, so Apache cannot run it. Try this instead:
#!/usr/bin/perl use strict; use warnings; print "Content-type: text/html\n\n"; print "<html>"; print "<header><title>Hello</title></header>"; print "<body>"; print "<p>Hello World!</p>\n"; print "</body>"; print "</html>"; 1;
The next problem is your Apache configuration. What version is Apache? You can find that by typing this into a terminal:
apachectl -V
If your Apache is 2.4, you need to add this line to the configuration:
Require all granted
That goes at the bottom of your directory configuration. Also make the changes that davebaker and AnonymousMonk have mentioned.
|
|---|