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

How does apache under NT find the perl interpreter?

( #34770=categorized question: print w/ replies, xml ) Need Help??
Contributed by clemburg on Sep 30, 2000 at 22:22 UTC
Q&A  > CGI programming


Description:

Under NT, how does apache find the perl interpreter when executing Perl CGI scripts?

How can one influence this?

Answer: How does apache under NT find the perl interpreter?
contributed by japhy

Believe it or not, Apache looks at your #! line. YES, it's true! The #! line IS USED in Windows!

Answer: How does apache under NT find the perl interpreter?
contributed by Wysardry

Actually, Apache under NT4 will allow you to use a shebang in the form of:

#!Perl/bin/perl

In other words, you don't need the drive letter if Apache and Perl are on the same drive and NT understands back and forward slashes in paths.

It also helps if you install Perl in a directory called "usr" instead of the default "Perl" so that you don't need to edit the shebang when you upload the script to a UNIX server. ;)

I wish someone had told me that before I installed it. :/

Oh, and the registry option does work, which is handy for running scripts on the command line.

Answer: How does apache under NT find the perl interpreter?
contributed by Anonymous Monk

It depends on your webserver software: Apache uses the shebang notation (the #! line). Most other webservers let you define the location of the perl executable in their preferences.

Answer: How does apache under NT find the perl interpreter?
contributed by shadox

Lets say you have perl in C:\perl\bin\perl
then your script should start like this

--------------------------------------

#!C:\perl\bin\perl

Answer: How does apache under NT find the perl interpreter?
contributed by ajt

Apache does indeed use a shebang notation, and in 1.3.something (?12) and above can read from the Windows Registry and work out where Perl is.

I must admit I use the shebang method, so I can't confirm that registry reading works.

Please (register and) log in if you wish to add an answer



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others studying the Monastery: (8)
    As of 2014-12-29 13:21 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (188 votes), past polls