Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

How to execute CGI with different extension

by manishrathi (Beadle)
on Dec 05, 2010 at 22:47 UTC ( [id://875520]=perlquestion: print w/replies, xml ) Need Help??

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

I have configured Perl in Path variable. I have testHTML.pl as Perl script in cgi-bin directory, so when an HTTP request comes in for testHTML.pl, this script will be executed and resulting output will be sent to browser. Instead of Perl, if I want to use pHp or Java language, I can use it, right ?

All I need to do is, set up jvm in the Path variable and in the cgi-bin directory, I need to put java byte code. For this example it will be testHTML.class. Now when request comes in for testHTML.class, this will be executed on server and resulting HTML page will be sent to broiwser.

What happens if I create a script with .cgi extension ? Say this is pHp scriopt created with .cgi extension. How does the server know, what language is this script creatres in and how to execute this script ? If I have two scripts both having .cgi extension. One is created using Perl script and other using pHp. How does server understand how to execute these scripts when a request comes in for these scripts ?

thanks
  • Comment on How to execute CGI with different extension

Replies are listed 'Best First'.
Re: How to execute CGI with different extension
by Anonymous Monk on Dec 06, 2010 at 00:07 UTC
    Instead of Perl, if I want to use pHp or Java language, I can use it, right ?

    How are we to know what abilities you have?

    All I need to do is, set up jvm in the Path variable and in the cgi-bin directory, I need to put java byte code. For this example it will be testHTML.class. Now when request comes in for testHTML.class, this will be executed on server and resulting HTML page will be sent to broiwser. What happens if I create a script with .cgi extension ? Say this is pHp scriopt created with .cgi extension. How does the server know, what language is this script creatres in and how to execute this script ? If I have two scripts both having .cgi extension. One is created using Perl script and other using pHp. How does server understand how to execute these scripts when a request comes in for these scripts ?

    See Shebang, Path variable, EXE

    Mostly its a matter of configuring your webserver/os

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found