ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Apache Web-Serving with Mac OS X: Part 2
Subject:   Cannot get perl script to work using cgi
Date:   2007-05-30 10:21:35
From:   AstroNerd
I followed the tutorial and am able to get the following to work:


test-cgi which contians:


#!/bin/sh


# disable filename globbing
set -f


echo Content-type: text/plain
echo


echo CGI/1.0 test script report:
echo


echo argc is $#. argv is "$*".
echo


and a document I made from the entries called script.cgi which contains:


#!/bin/sh
echo "Content-type: text/html"
echo
echo "Something"


I can display them by just going to http://127.0.0.1/cgi-bin/script.cgi


Now the problem is I want to display something like:


#!/usr/bin/perl
#
# Program to do the obvious
#
print 'Hello world.'; # Print a message


and I get and error message:


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.



Apache/1.3.33 Server at 127.0.0.1 Port 80


Any advice? (Note, I already did "sudo chmod 755 FileName.cgi)


1 to 1 of 1
  1. Cannot get perl script to work using cgi
    2007-09-05 10:32:22  abajay [View]

1 to 1 of 1