in reply to Why does this download the script file instead of displaying the results?

This is a web server/file system issue.

My first instinct is to tell you to migrate to another Unix based web hoster... ;)

You need to ensure that your Apache config file allows www execute privileges on the script directory ( presumably cgi-bin )

Next, you need to ensure that your OS can determine what type of file you are trying to run ( afaik, Windows doesn't read into a file, so it can't read the shebang line ).

From what you've said, it sounds like an Apache handler issue if it forces a download. Apache does not know how to render the non-HTML file, so it offers it up as a download.

Do you have to register .pl and like files by extension in Apache on Windows?

Steve

  • Comment on Re: Why does this download the script file instead of displaying the results?

Replies are listed 'Best First'.
Re^2: Why does this download the script file instead of displaying the results?
by thenodemaster (Initiate) on Nov 11, 2009 at 21:43 UTC
    Thank you very much for your reply. I just figured out what was going on. And, to answer your questions regarding registering perl with Apache and associating the .pl and .cgi extensions, yes they had to be associated with the perl executable. But, what I found was almost too blatant and comical at the same time I am busting up laughing still! The path and info in the script were all correct. However, the error was in the .EXE file that was called up. I did not know there was a difference between perl.exe and perl5.10.1.exe. Once I pointed the script at the perl5.10.1.exe instead of just perl.exe, everything works just like it should have from the begining. You can check out the page below to see what I have been pulling my hair out to get to work. Oh, PS, eventually, I will be migrating to a Linux box, but since I can get Windows up and running faster and I was getting frustrated with configuration issues on setup with Linux due to my STEEP learning curve. But I do like the security of Linux/Unix better than Windows. But, like I said, my web host went tits up (not the first one to do that to me) I decided to do my own and Windows provided the quickest route while I learned Linux.


    Anyway, here is what the script does:


    http://node3d.servehttp.com/kwrgb.cgi



    Thanks again! Scott