Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Unknown File Type

by NewtoThis (Initiate)
on Mar 16, 2010 at 12:43 UTC ( [id://828912]=perlquestion: print w/replies, xml ) Need Help??

NewtoThis has asked for the wisdom of the Perl Monks concerning the following question:

I'm new to this stuff so please accept my apologies if this is a stupid question with a simple answer. I have a postcard program which works perfectly well on one domain. I also want to use it on another domain - on the same server. So I made the changes, uploaded it all and the index page shows beautifully. But when I choose a card and click next, I get a File Download box telling me card.cgi is an unknown file type and do I want to download the file or find a program online to open it. Is the file corrupted or have I done something wrong? Any guidance appreciated.

Replies are listed 'Best First'.
Re: Unknown File Type
by almut (Canon) on Mar 16, 2010 at 12:57 UTC

    You have to configure your webserver to execute your script. Typically, there's a cgi-bin directory, which is already configured to execute the CGI scripts which are in it (e.g. with ScriptAlias or ExecCGI in case you're using Apache — in this case, also see the tutorial Dynamic Content with CGI).  OTOH, this can also be configured by extension (e.g., .cgi, .pl), etc.

    Also note that (with Apache on *nix) the CGI script additionally needs to be executable (i.e. have the 'x' bit set for user/group/other (whichever applies) — in case of doubt, try chmod a+x card.cgi).

      Thank you! I found an Apache Handler in the domain's CPanel and activated the cgi, ppl.....one. Tried the postcard program again from my browser - AND IT WORKED BEAUTIFULLY. A thousand thank-yous. I would have reuploaded and downloaded and changed and uploaded and downloaded and changed till next Christmas and still wouldn't have got anywhere.
Re: Unknown File Type
by herveus (Prior) on Mar 16, 2010 at 13:01 UTC
    Howdy!

    I'm having a hard time seeing the Perl content in the question.

    You don't say whether you are using Apache or something else. The behavior suggests that the second domain is configured differently than the first, such that .cgi files are not recognized as executable in the second domain. Compare the configuration details for both domains and see what is different about executables. Without more details, it is impossible to say anything more specific.

    yours,
    Michael
      Hi Michael - Ditto what I said above! Thank you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://828912]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-18 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found