in reply to Re: Re: print statement does not work
in thread print statement does not work

Folks here might be able to help if you:

The information you've provided so far is too vague.

By the way, what do you get in response to either of these two commands:

type perl which perl
Those should print the path where your shell finds the perl executable, given your current PATH setting. That is what should be on the shebang line of any perl script you write. (Note: this could report the path to a version of perl that you did not install yourself. You do know the path to the version you installed, right? Did you actually place your installation in /usr/local/bin?)

Replies are listed 'Best First'.
Re: Re: Re: Re: print statement does not work
by Hammy (Scribe) on Dec 17, 2002 at 03:47 UTC
    The code I am trying to run is trivial:
    #!/bin/perl print "Content-type: text/html\n\n"; print "hi";
    When typing both type and which perl, I get /bin/perl. I changed the code to now use that path and I still get the error message :
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@thed87.tempdomainna +me.com and inform them of the time the error occurred, and anything y +ou might have done that may have caused the error.
    More information about this error may be available in the server error log.

    Unfortunately there is no webmaster - I'm it. I have a huge site that I am porting from FreeBSD to Solaris and I am just trying to get a simple program to run.

    I have had absolutely no experience installing or manipulating perl. The FreeBSD environment was a managed hosting environment where everything was standard and maintained by the host.

    update (broquaint): removed <br>s in <code> tags and put <code> tags around the error message

      I assume that the "<br>" strings I see in your code are not really part of your perl script; these (I hope) are due to a misunderstanding about how postings are done here -- check out the Site How To and Perl Monks Site FAQ. (If those tags are in your perl script, take them out; they don't belong there.)

      Have you checked the ownership and permissions on the script file? It needs to be globally readable and executable by the user account that runs the web server (usually "nobody"); it also needs to be in a path that the server account can reach (all directory levels above the script file must grant read and execute permissions to the web server's user account).

      But I suppose the error message might have said something about "permission denied" if it was a mode-flag problem...

      Since you're the boss on that system, you must know where the web server's error log is. Generate the failure, then run "tail" on the error log, to see what the perl interpreter or web server said about the nature of the error.

      Apart from the "break" tags that don't belong there, I don't see anything about the script itself that should be a problem. Check the web server config file, to make sure it's enabled to execute a cgi script in the directory where you have placed this script, etc.