Install, Setup and Configure CGI and Perl in Windows XP Installare, installazione e configurazione CGI e Perl in Windows XP

Prerequisite Prerequisito

Obvioulsy, a web server needs to be running on the Windows machine. Obvioulsy, un server web deve essere in esecuzione sulla macchina Windows. Refer to this Riferimento a questo post for instructions on how to install Apache2 in Windows. per le istruzioni su come installare Apache2 in Windows.

Download ActivePerl Download ActivePerl

Download ActivePerl from ActivePerl da scaricare http://www.activestate.com/Products/ActivePerl/?mp=1 . Click on Free Download to start the download process. Fare clic su Download gratuito per avviare il processo di download. There is no need to input any contact info. Non vi è alcuna necessità di inserire qualsiasi informazioni di contatto. Just leave it blank and press ‘Next’ to start the download. Solo lasciarla vuota e premere 'Avanti' per avviare il download.

Then download the lastest version of Windows MSI package. Quindi scaricare l'ultima versione di Windows pacchetto MSI.

Install ActivePerl Installare ActivePerl

Start the installation by double clicking the setup file. Avviare l'installazione facendo doppio clic sul file di installazione. Follows the on-screen instruction. Segue le istruzioni a schermo. If you will be using Perl CGI programs and want to maintain some level of portability between both Linux machines and Windows machines, you may want to install Perl at the same location on your Windows machine as it is on most Linux machines. Se utilizzerai programmi Perl CGI e vogliono mantenere un certo livello di portabilità tra le due macchine Linux e Windows macchine, è possibile che si desideri installare Perl nella stessa posizione sul tuo computer Windows in quanto è sulla maggior parte delle macchine Linux.

For example, on Linux machine, Perl is located at /usr/bin/perl and so every Perl program that I write begins with #!/usr/bin/perl . Per esempio, sulla macchina Linux, Perl si trova in / usr / bin / perl e così ogni programma Perl che scrivo inizia con #! / Usr / bin / perl. So, it’s best when install Perl on an Windows machine, instead of installing it in the default location (ie C:\perl), install it in C:\usr instead, so that the Perl executable is located at /usr/bin/perl. Quindi, è meglio quando installare Perl su una macchina Windows, invece di installarlo nella posizione di default (ad esempio C: \ perl), installarlo in C: \ usr invece, in modo che il Perl eseguibile si trova in / usr / bin / perl. This allows codes written on Windows machine been moved to, without changes, to Linux machine, and have it run there, and vice versa. Questo permette codici scritti a macchina Windows stato spostato, senza modifiche, a macchina Linux, e farlo funzionare, e viceversa.

To change the installation path, click on browse button when you’re on the installation screen that prompts you to select which features you want to install. Per modificare il percorso di installazione, fare clic sul pulsante Sfoglia quando sei sulla schermata di installazione che richiede di selezionare le caratteristiche che si desidera installare. Set it to C:\usr\ if needed. Impostarlo su C: \ usr \ se necessario.

Make sure that the following options is checked (selected): Assicurarsi che le seguenti opzioni è selezionata (selezione):
Add Perl to the PATH environment variable Aggiungi il Perl variabile di ambiente PATH
Create Perl file extension association Perl creare file con estensione associazione

Activating CGI Attivazione CGI

Open the httpd.conf file for editing by selecting Start > Programs > Apache HTTP Server > Configure Apache Server > Edit the Apache httpd.conf Configuration File. Aprire il file httpd.conf per la modifica selezionando Start> Programmi> Apache HTTP Server> Configura server Apache> Modifica Apache httpd.conf file di configurazione. Alternatively, open the httpd.conf with any text editor. In alternativa, aprire il httpd.conf con qualsiasi editor di testo.

In the main directory section, search for Options Indexes FollowSymLinks (at about line 267), and add ExecCGI to the end so it looks like: Nella directory principale sezione Opzioni di ricerca per FollowSymLinks Indexes (linea a circa 267) e aggiungere ExecCGI alla fine in modo che appare come segue:

Options Indexes FollowSymLinks ExecCGI Opzioni indici ExecCGI FollowSymLinks

Search for the following line and remove the hash mark character (#) to uncomment this line. Cerca la seguente riga e rimuovere il carattere carattere (#) per togliere il commento a questa linea. (You can also change .cgi to .pl, or add .pl behind .cgi if you prefer that perl extention is also treated as cgi files) For example: (Potete anche cambiare. Cgi. Pl, o aggiungere. Pl dietro. Cgi se si preferisce che perl estensione è anche trattata come file CGI) Ad esempio:

#AddHandler cgi-script .cgi # AddHandler cgi-script. Cgi

Should look like: Dovrebbe essere simile:

AddHandler cgi-script .cgi .pl AddHandler cgi-script. Cgi. Pl
or o
AddHandler cgi-script .pl AddHandler cgi-script. Pl
or o
AddHandler cgi-script .cgi AddHandler cgi-script. Cgi

Save the httpd.conf configuration file, restart the Apache server. Salvare il file di configurazione httpd.conf, riavviare il server Apache. Test the configuration as described in Testing Your Web Server CGI Configuration at the end of this article. La configurazione di prova, come descritto in fase di test il server Web CGI di configurazione, alla fine di questo articolo.

Optional: Enabling CGI in Any Directory Opzionale: L'attivazione di CGI in qualsiasi cartella

If you want to use CGI outside ScriptAliased directory (ScriptAlias is usually the Apache2/cgi-bin/), comment out the following line: Se si desidera utilizzare CGI al di fuori ScriptAliased directory (ScriptAlias è di solito il Apache2/cgi-bin /), commentare la riga seguente:

ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/” ScriptAlias / cgi-bin / "C: / Program Files / Apache Group/Apache2/cgi-bin /"

Should look like: Dovrebbe essere simile:

#ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/” # ScriptAlias / cgi-bin / "C: / Program Files / Apache Group/Apache2/cgi-bin /"

Alternatively, if you want to specify just one directory to put all your cgi programs, change the path instead, but makes ure that directory exists. In alternativa, se si desidera specificare una sola directory per mettere tutti i vostri programmi cgi, modificare il percorso, invece, ma rende ure quella directory esiste.

Should look like (for default settings): Dovrebbe essere simile (per default):

ScriptAlias /cgi-bin/ “your_prefer_cgi-bin_direcotry” ScriptAlias / cgi-bin / "your_prefer_cgi-bin_direcotry"

Save the httpd.conf file. Salvare il file httpd.conf. Restart the Apache server. Riavviare il server Apache.

Finding Perl Executable Location Trovare perl eseguibile Ubicazione

If you don’t know where is perl.exe installed to, go to Start -> Search and search for perl.exe. Se non sai dove è installato a perl.exe, vai su Start -> Cerca e ricerca di perl.exe. This location is the path to the perl executable that has to be put on the top of all cgi scripts. Questo percorso è il percorso del perl eseguibile che deve essere messo in cima a tutti i script CGI. If you follow default installation procedure, the path should be C:/perl/bin/perl.exe Se si segue procedura di installazione di default, il percorso deve essere C: / perl / bin / perl.exe

For the path to perl.exe path, all of these format are valid: Per il percorso perl.exe percorso, tutti questi sono validi formato:
#!c:/perl/bin/perl.exe #! c: / perl / bin / perl.exe
#!c:/perl/bin/perl #! c: / perl / bin / perl
#!/perl/bin/perl.exe #! / perl / bin / perl.exe
#!/perl/bin/perl #! / perl / bin / perl

Testing Your Web Server CGI Configuration Test il vostro web server CGI di configurazione

Save the following test script in your DocumentRoot directory (if you have uncomment ScriptAlias, you can put it anywhere inside your DocumentRoot directory, or if you have set ScriptAlias to some particular directory, put the cgi in that directory only, ie Apache2/cgi-bin) as test.pl or test.cgi (depending on your configuration of the AddHandler line) and modify the first line as required to point to your ActivePerl interpreter: Salva la prova seguente script nella vostra directory DocumentRoot (se si dispone di togliere il ScriptAlias, va inserito ovunque all'interno della vostra directory DocumentRoot, o se avete impostato ScriptAlias ad alcune directory particolare, mettere il cgi in quella directory solo, vale a dire Apache2/cgi- bin) o come test.pl test.cgi (a seconda della propria configurazione di AddHandler la linea) e modificare la prima linea, come previsto al punto a vostro interprete ActivePerl:

#!c:\perl\bin\perl.exe #! c: \ perl \ bin \ perl.exe
# ^^^ this must be the first line of the script! # ^ ^ ^ Questa deve essere la prima linea dello script! ^^^ ^ ^ ^
# start code # Inizio codice

use strict; use strict;
use CGI; utilizzare CGI;
my $q = new CGI; my $ q = new CGI;

# print header and start the markup output # Stampa intestazione e iniziare la produzione di marcatura

print $q->header( “text/html” ),$q->start_html( “hello from perl cgi!” ); print $ q-> header ( "text / html"), $ q-> start_html ( "ciao da perl cgi!");
print $q->h2(”hello dave…”); print $ q-> H2 ( "ciao dave…");
print $q->end_html; print $ q-> end_html;
# end code # Fine codice

Now go to Adesso vai a http://localhost/cgi-bin/test.cgi (scripts in Apache2/cgi-bin/ are read as http://localhost/cgi-bin/ by default). (script in Apache2/cgi-bin / vengono lette come http://localhost/cgi-bin/ per impostazione predefinita). You should see a page that displays a level two heading with the following text: Si dovrebbe vedere una pagina che visualizza un livello due voce con il testo seguente:

hello dave Ciao Dave

If you see the above message, CGI is running. Se viene visualizzato il messaggio di cui sopra, CGI è in esecuzione. If you get a 500 error, go to the last entry in your Apache2/logs/error.log (or the Review Error Log in the Start menu) to see exactly what caused this error. Se si ottiene un errore 500, vai a questo ultimo ingresso nella vostra Apache2/logs/error.log (o la modifica di errore Entra nel menu Start) per vedere esattamente che cosa ha provocato questo errore.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Questa è una pagina tradotta macchina che è fornito "così com'è" senza alcuna garanzia. Machine translation may be difficult to understand. Traduzione automatica può essere difficile da capire. Please refer to Si prega di fare riferimento a original English article articolo originale inglese whenever possible. quando possibile.

Share and contribute or get technical support and help at Condividere e contribuire o ottenere supporto tecnico e assistenza in My Digital Life Forums La mia vita digitale Forum .



6 Responses to “Install, Setup and Configure CGI and Perl in Windows XP” 6 risposte a "Installa, il programma di installazione e configurazione CGI e Perl in Windows XP"

  1. Install AWStats- Free Logfile Analyzer for Site Statistics » My Digital Life Installare awstats-free analizzatore di file di log per le statistiche del sito »La mia vita digitale
    January 2nd, 2006 02:19 2 gennaio 2006 02:19
    1

    [...] As AWStats is Perl based, a Perl Interpreter need to be installed first to take anvantage of AWStats. [...] Come AWStats è basato su Perl, un interprete Perl deve essere installato prima di prendere anvantage di AWStats. For instruction on how to install Perl in Windows machine, check out this article. Per istruzioni su come installare Perl in macchina Windows, leggi questo articolo. [...]

  2. Besart
    July 25th, 2006 20:53 25 luglio 2006 20:53
    2

    I have installed cgi and configured apache as you said, but i got this erro: Ho installato e configurato cgi apache come lei ha detto, ma ho ottenuto questo errore:

    Internal Server Error Errore interno del server
    The server encountered an internal error or misconfiguration and was unable to complete your request. Il server ha incontrato un errore interno o di una errata e non è riuscito a completare la richiesta.

    Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. Si prega di contattare l'amministratore del server, webmaster @ localhost e comunicare loro il tempo si è verificato l'errore, e tutto ciò che si potrebbe avere fatto che possono avere causato l'errore.

    More information about this error may be available in the server error log. Maggiori informazioni su questo errore può essere disponibile nel registro di errore del server.

    ——————————————————————————– ---------------------------

    Apache/2.0.58 (Win32) PHP/5.1.4 Server at localhost Port 80 Apache/2.0.58 (Win32) PHP/5.1.4 Server a localhost Port 80

  3. jack Jack
    May 10th, 2007 19:25 May 10th, 2007 19:25
    3

    Cool4you,guys. Cool4you, ragazzi.

  4. Mitchell
    June 20th, 2007 08:09 20 giugno 2007 08:09
    4

    Just for the record, the above test script throws a 500 error when used as is. Solo per la cronaca, la prova di cui sopra getta uno script di errore 500 quando viene utilizzato come è. Maybe it is just a problem with firefox displaying text or something, but the quotation marks are mixed up, so that could lead to problems Forse si tratta solo di un problema con Firefox la visualizzazione di testo o qualcosa, ma i segni di citazione vengono confusi, in modo tale che potrebbe portare a problemi :)

  5. Johanna
    October 8th, 2007 23:05 8 ottobre 2007 23:05
    5

    Hi all, Ciao a tutti,

    I really need some help on this subject =) Io ho bisogno di aiuto su questo argomento =)

    I have followed the steps above, and changed the quotation marks, and what I get is 9 error messages: Ho seguito la procedura di cui sopra, e cambiato le virgolette, e quello che ricevo è di 9 messaggi di errore:

    Backslash found where operator expected at Z.\test.cgi line 1, near “rtf1\” Backslash trovato dove operatore attesi per Z. \ test.cgi linea 1, vicino "rtf1 \"
    or …. o…. , near “ansi\” , Vicino a "ansi \"
    or …. o…. , near “deff0″ , Vicino a "deff0"
    or …. o…. , near “f1\” , Vicino a "f1 \"
    etc.. ecc.

    I am a total rookie with these things, any help appreciated =) Io sono un totale rookie con queste cose, di tutto l'aiuto apprezzato =)

    Thanks, Grazie,

    Johanna

  6. Munir
    November 28th, 2007 22:14 28 novembre 2007 22:14
    6

    I did everything you said. Ho fatto tutto ciò che ha detto. But cgi is still not running. Cgi, ma non è ancora in esecuzione. Please help. Please help.
    my apache is 2.2 Apache è il mio 2,2

Leave a Reply Lasciare una risposta

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> È possibile utilizzare questi tag: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Iscriviti senza commentare


Custom Search

New Articles Nuovi articoli

Incoming Search Terms for the Article Cerca in arrivo Condizioni per l'articolo

download perl.exe scaricare perl.exe - -- install perl on windows xp installare Perl su Windows XP - -- Perl.exe download Perl.exe scaricare - -- perl.exe perl.exe - -- apache2 enable cgi apache2 consentire CGI - -- perl apache2 Perl apache2 - -- perl for windows XP Perl per Windows XP - -- perl vista Perl Vista - -- enable cgi apache2 CGI consentire di apache2 - -- install perl on vista installare Perl su Vista - -- how to install perl on windows XP come installare perl su Windows XP - -- configure perl configurare Perl - -- perl setup download Perl setup download - -- install perl xp installare Perl XP - -- download perl for windows xp Perl download per Windows XP - -- PERL for windows vista PERL per Windows Vista - -- perl download for windows xp Perl il download per Windows XP - -- XAMPP Perl CGI XAMPP Perl CGI - -- xampp path to perl XAMPP percorso di Perl - -- download perl setup Perl scaricare setup - -- perl windows vista Perl Windows Vista - -- install perl vista installare Perl Vista - -- xampp perl path XAMPP Perl percorso - -- free download perl.exe download gratuito perl.exe - -- perl download xp Perl scaricare XP - -- apache2 perl apache2 Perl - -- apache2 cgi enable apache2 consentire CGI - -- configure cgi configurare CGI - -- how to configure perl come configurare Perl - -- free download perl interpreter download gratuito interprete Perl - -- INSTALL PERL FOR WINDOWS XP Installare perl per Windows XP - -- apache2 configure cgi apache2 configurare CGI - -- Perl interpreter for windows XP Perl interprete per Windows XP - -- all tutto - -- how to install perl on vista come installare perl su Vista - -- perl interpreter free download interprete Perl download gratuito - -- perl for xp Perl per XP - -- install perl windows xp Perl installare Windows XP - -- perl interpreter vista Vista interprete Perl - -- windows xp cgi Windows XP CGI - -- how to install perl in windows xp come installare perl in Windows XP - -- perl download for xp Perl scaricare per XP - -- apache perl configuration Perl configurazione di Apache - -- perl.exe free download perl.exe download gratuito - -- install perl on xp installare Perl su XP - -- how to configure cgi come configurare CGI - -- perl exe download Perl exe download - -- perl setup Perl setup - -- enable cgi in apache2 consentire CGI in apache2 - -- apache2 allow cgi apache2 consentire CGI - -- Free Download Perl for Windows XP Download gratuito Perl per Windows XP - -- perl interpreter for vista interprete Perl per Vista - -- perl for windows XP download Perl per Windows XP download - -- apache2 perl setup Perl installazione di apache2 - -- apache2 configure perl apache2 configurare Perl - -- how to install perl on windows vista come installare perl a Windows Vista - -- Perl Windows XP Perl Windows XP - -- perl setup for windows Perl di installazione per Windows - -- perl windows configuration Perl configurazione di Windows - -- download perl exe exe scaricare Perl - -- download perl Windows XP Perl scaricare Windows XP - -- configure perl apache2 Perl configurare apache2 - -- enable cgi on apache consentire CGI su Apache - -- xampp perl configure XAMPP Perl configurare - -- free perl download for Windows XP perl scaricare gratuitamente per Windows XP - -- "perl for vista" "Perl per la Vista" - -- how to install perl on xp come installare perl su xp - -- perl windows install Perl installare Windows - -- How to Configure Perl in Windows Come configurare il Perl in Windows - -- xampp enable cgi XAMPP consentire CGI - -- apache2 cgi configuration CGI di configurazione di apache2 - -- perl download windows xp Perl scaricare Windows XP - -- perl configure Perl configurare - -- perl interpreter windows vista interprete Perl Windows Vista - -- configure cgi apache2 CGI configurare apache2 - --