I'm having various frustrations trying to get a perl cgi script to work. I'm trying to implement a very simple "hello world" script with no success. Here are the details.
Contents of my index.shtml file:
<!--#exec cgi="/cgi-bin/test.pl" -->
<!--#include virtual="/cgi-bin/test.pl" -->
And the contents of the test.pl file:
print "Content-type: text/html\r\n\r\n";
print "Hello, World.";
As you can see, I'm trying two different ways simultaneously. The SSI "include virtual" directive does throw and error but the "exec cgi" does not. Server error is:
unable to include "/cgi-bin/test.pl" in parsed file /home/<username>/public_html/index.shtml
When I access the index.shtml page, I get the "[an error occurred while processing this directive]" generated from the SSI call but nothing from the CGI call. I expect nothing from the CGI call because when I call the file directly (www.mywebsite.com/cgi-bin/test.pl
) I get nothing. The script works perfectly when initiated from shell on my local system. I feel like the problem is in my htaccess file which I've tried numerous variations but the following is what is currently in place:
AddType text/html .shtml
AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes
AddHandler cgi-script .cgi .pl
Also worth noting, all files have 755 permissions, and the .htaccess file is located in the public_html directory. Does anyone have an idea of what may be causing my issues? I feel like its something simple but I'm at wits end!
Thanks in advance for any input or advice.