Install, Setup and Configure CGI and Perl in Windows XP Installer, installer et configurer CGI et Perl sous Windows XP

Prerequisite Pré-requis

Obvioulsy, a web server needs to be running on the Windows machine. Obvioulsy, un serveur Web doit être en cours d'exécution sur la machine Windows. Refer to this Reportez-vous à cette post poste for instructions on how to install Apache2 in Windows. pour obtenir des instructions sur la façon d'installer Apache2 dans Windows.

Download ActivePerl Télécharger ActivePerl

Download ActivePerl from Téléchargement de ActivePerl http://www.activestate.com/Products/ActivePerl/?mp=1 . Click on Free Download to start the download process. Cliquez sur Téléchargement gratuit pour démarrer le processus de téléchargement. There is no need to input any contact info. Il n'est pas nécessaire de saisir une coordonnées. Just leave it blank and press ‘Next’ to start the download. Il suffit de laisser ce champ vide et appuyez sur "Suivant" pour commencer le téléchargement.

Then download the lastest version of Windows MSI package. Alors téléchargez la dernière version de Windows package MSI.

Install ActivePerl Installez ActivePerl

Start the installation by double clicking the setup file. Démarrez l'installation en double cliquant sur le fichier d'installation. Follows the on-screen instruction. Suit à l'écran l'instruction. 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. Si vous comptez utiliser des programmes CGI en Perl et que vous voulez maintenir un certain niveau de portabilité entre les deux machines Linux et Windows machines, mai vous voulez installer Perl au même endroit sur votre machine Windows comme elle l'est sur la plupart des machines 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 . Par exemple, le système d'exploitation Linux, Perl se trouve dans / usr / bin / perl et Perl afin que chaque programme que je commence par écrire #! / 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. Donc, il vaut mieux lorsqu'ils installent Perl sur une machine Windows, au lieu de l'installer dans l'emplacement par défaut (c'est-à-dire C: \ perl), installez-le dans C: \ usr lieu, de sorte que Perl exécutable se trouve dans / 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. Cela permet à des codes écrits sur machine Windows à été déplacé, sans modification, à machine Linux, et de la faire exécuter, et vice versa.

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. Pour changer le chemin d'installation, cliquez sur le bouton de recherche lorsque vous êtes sur l'écran d'installation qui vous invite à sélectionner les fonctionnalités que vous voulez installer. Set it to C:\usr\ if needed. Réglez-le dans C: \ usr \ si nécessaire.

Make sure that the following options is checked (selected): Assurez-vous que l'une des options suivantes est cochée (sélection):
Add Perl to the PATH environment variable Ajouter Perl pour la variable d'environnement PATH
Create Perl file extension association Créer Perl extension de fichier d'association

Activating CGI Activation de 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. Ouvrez le fichier httpd.conf pour l'édition en sélectionnant Démarrer> Programmes> Apache HTTP Server> Configurer Apache Server> Modifier Apache fichier de configuration httpd.conf. Alternatively, open the httpd.conf with any text editor. Sinon, ouvrez le fichier httpd.conf avec un éditeur de texte.

In the main directory section, search for Options Indexes FollowSymLinks (at about line 267), and add ExecCGI to the end so it looks like: Dans le répertoire principal section, recherchez Options Indexes FollowSymLinks (à près de la ligne 267), et ajouter ExecCGI à la fin il se présente comme suit:

Options Indexes FollowSymLinks ExecCGI Options Indexes FollowSymLinks ExecCGI

Search for the following line and remove the hash mark character (#) to uncomment this line. Recherche de la ligne suivante et supprimer le caractère dièse (#) pour décommenter cette ligne. (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: (Vous pouvez également changer. Cgi. Pl, ou ajouter. Pl derrière. Cgi si vous préférez que perl extension est aussi traitée comme fichiers CGI) Par exemple:

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

Should look like: Devrait ressembler à:

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

Save the httpd.conf configuration file, restart the Apache server. Enregistrez le fichier de configuration httpd.conf, redémarrez le serveur Apache. Test the configuration as described in Testing Your Web Server CGI Configuration at the end of this article. Pour tester la configuration comme décrit dans les essais de votre serveur Web CGI de configuration à la fin de cet article.

Optional: Enabling CGI in Any Directory Facultatif: L'activation de CGI dans n'importe quel répertoire

If you want to use CGI outside ScriptAliased directory (ScriptAlias is usually the Apache2/cgi-bin/), comment out the following line: Si vous souhaitez utiliser en dehors de CGI ScriptAliased répertoire (ScriptAlias est généralement le Apache2/cgi-bin /), commentez la ligne suivante:

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: Devrait ressembler à:

#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. Par ailleurs, si vous voulez spécifier un seul répertoire à mettre tous vos programmes CGI, changer le chemin d'accès au lieu, mais fait ure ce répertoire existe.

Should look like (for default settings): Devrait ressembler (pour les réglages par défaut):

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

Save the httpd.conf file. Enregistrez le fichier httpd.conf. Restart the Apache server. Redémarrez le serveur Apache.

Finding Perl Executable Location Trouver l'emplacement exécutable perl

If you don’t know where is perl.exe installed to, go to Start -> Search and search for perl.exe. Si vous ne savez pas où est installé à perl.exe, allez dans Démarrer -> Recherche et de recherche pour perl.exe. This location is the path to the perl executable that has to be put on the top of all cgi scripts. Cet emplacement est le chemin vers l'exécutable perl qui doit être mis sur la partie supérieure de tous les scripts cgi. If you follow default installation procedure, the path should be C:/perl/bin/perl.exe Si vous suivez la procédure d'installation par défaut, le chemin doit être C: / perl / bin / perl.exe

For the path to perl.exe path, all of these format are valid: Par la voie de chemin perl.exe, tous ces format sont valables:
#!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 de votre serveur Web CGI de configuration

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: Enregistrez le script de test suivants dans votre répertoire DocumentRoot (si vous avez décommenter ScriptAlias, vous pouvez placer n'importe où dans votre répertoire DocumentRoot, ou si vous avez défini ScriptAlias à certains répertoire, mettez le cgi dans ce répertoire seulement, c'est-à-dire Apache2/cgi- bin) ou test.cgi test.pl (en fonction de votre configuration de la ligne AddHandler) et de modifier la première ligne au besoin pour pointer sur votre ActivePerl interprète:

#!c:\perl\bin\perl.exe #! c: \ perl \ bin \ perl.exe
# ^^^ this must be the first line of the script! # ^ ^ ^ Ce doit être la première ligne du script! ^^^ ^ ^ ^
# start code # Code de début

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

# print header and start the markup output # Tête d'impression et de commencer la production de marquage

print $q->header( “text/html” ),$q->start_html( “hello from perl cgi!” ); print $ q-> header ( "text / html"), $ q-> start_html ( "bonjour de CGI en Perl!");
print $q->h2(”hello dave…”); print $ q-> h2 ( "bonjour dave…");
print $q->end_html; print $ q-> end_html;
# end code # Fin du code

Now go to Maintenant, allez dans http://localhost/cgi-bin/test.cgi (scripts in Apache2/cgi-bin/ are read as http://localhost/cgi-bin/ by default). (scripts dans Apache2/cgi-bin / sont lus comme http://localhost/cgi-bin/ par défaut). You should see a page that displays a level two heading with the following text: Vous devriez voir une page qui affiche un niveau deux positions avec le texte suivant:

hello dave Bonjour Dave

If you see the above message, CGI is running. Si vous voyez le message ci-dessus, CGI est en cours d'exécution. 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. Si vous obtenez une erreur 500, allez à la dernière entrée dans votre Apache2/logs/error.log (ou l'examen log d'erreurs dans le menu Démarrer) pour voir exactement ce qui a causé cette erreur.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANT: Il s'agit d'une machine qui traduit la page est fourni «tel quel», sans garantie. Machine translation may be difficult to understand. La traduction automatique mai être difficile à comprendre. Please refer to S’il vous plaît se référer à original English article l'article original en anglais whenever possible. chaque fois que possible.

Share and contribute or get technical support and help at Partagez et contribuer ou obtenir de l'aide technique et l'aide à My Digital Life Forums Ma vie numérique forums .



6 Responses to “Install, Setup and Configure CGI and Perl in Windows XP” 6 réponses à "Installation, configuration et configurer CGI et Perl sous Windows XP"

  1. Install AWStats- Free Logfile Analyzer for Site Statistics » My Digital Life Installer AWStats-analyseur de logs Gratuit pour les statistiques du site »Ma vie numérique
    January 2nd, 2006 02:19 Janvier 2 septembre 2006 02h19
    1

    [...] As AWStats is Perl based, a Perl Interpreter need to be installed first to take anvantage of AWStats. [...] Comme AWStats est basée Perl, Perl un interprète doivent être installés premier à prendre anvantage de AWStats. For instruction on how to install Perl in Windows machine, check out this article. Pour des instructions sur comment installer Perl machine sous Windows, consultez cet article. [...]

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

    I have installed cgi and configured apache as you said, but i got this erro: J'ai installé et configuré cgi apache comme vous l'avez dit, mais j'ai eu cette erreur:

    Internal Server Error Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request. Le serveur a rencontré une erreur interne ou une mauvaise et n'a pas été en mesure de traiter votre demande.

    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. S’il vous plaît contactez l'administrateur du serveur, webmaster @ localhost et les informer du moment où l'erreur s'est produite, et tout ce que vous pourriez avoir fait mai ont causé l'erreur.

    More information about this error may be available in the server error log. Plus d'informations sur cette erreur mai sont disponibles sur le serveur de log d'erreurs.

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

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

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

    Cool4you,guys. Cool4you, les gars.

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

    Just for the record, the above test script throws a 500 error when used as is. Juste pour mémoire, le script de test ci-dessus lance une erreur 500 lorsque utilisé tel quel. 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 Peut-être que c'est juste un problème avec firefox l'affichage du texte ou quelque chose, mais les guillemets sont mélangés, de manière à ce que pourrait donner lieu à des problèmes :)

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

    Hi all, Salut tous,

    I really need some help on this subject =) J'ai vraiment besoin d'aide sur ce sujet =)

    I have followed the steps above, and changed the quotation marks, and what I get is 9 error messages: J'ai suivi les étapes ci-dessus, et a modifié les guillemets, et ce que je reçois est de 9 messages d'erreur:

    Backslash found where operator expected at Z.\test.cgi line 1, near “rtf1\” Backslash là où l'opérateur devrait à Z. \ test.cgi ligne 1, près de "rtf1 \"
    or …. ou…. , near “ansi\” , Près de "ansi \"
    or …. ou…. , near “deff0″ , Près de "deff0"
    or …. ou…. , near “f1\” , Près de "f1 \"
    etc.. etc.

    I am a total rookie with these things, any help appreciated =) Je suis un débutant total avec ces choses, toute aide est appréciée =)

    Thanks, Merci,

    Johanna

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

    I did everything you said. Je ne vous dit tout. But cgi is still not running. Cgi, mais n'est pas encore en cours d'exécution. Please help. S’il vous plaît aider.
    my apache is 2.2 mon Apache est de 2,2

Leave a Reply Laisser un commentaire

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> Vous pouvez utiliser ces balises: <a href="" title="fete_christel <abbr title="fete_christel <acronym title="fete_christel <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting S'abonner sans commentaires


Custom Search

New Articles Nouveaux Articles

Incoming Search Terms for the Article Des termes de recherche utilisés pour l'article

download perl.exe télécharger perl.exe - -- install perl on windows xp installer Perl sur Windows XP - -- Perl.exe download Perl.exe télécharger - -- perl.exe perl.exe - -- apache2 enable cgi apache2 permettre CGI - -- perl apache2 Perl apache2 - -- perl for windows XP Perl pour Windows XP - -- perl vista Perl Vista - -- enable cgi apache2 CGI permettre apache2 - -- install perl on vista installer Perl sur Vista - -- how to install perl on windows XP comment installer Perl sur Windows XP - -- configure perl configurer Perl - -- perl setup download Perl installation télécharger - -- install perl xp Perl installer XP - -- download perl for windows xp télécharger Perl pour Windows XP - -- PERL for windows vista PERL pour Windows Vista - -- perl download for windows xp Perl télécharger pour Windows XP - -- XAMPP Perl CGI XAMPP Perl CGI - -- xampp path to perl XAMPP chemin de Perl - -- download perl setup télécharger la configuration Perl - -- perl windows vista Perl Windows Vista - -- install perl vista installer Perl Vista - -- xampp perl path Perl XAMPP chemin - -- free download perl.exe téléchargement gratuit perl.exe - -- perl download xp Perl télécharger XP - -- apache2 perl apache2 Perl - -- apache2 cgi enable CGI permettre apache2 - -- configure cgi configurer CGI - -- how to configure perl comment configurer Perl - -- free download perl interpreter téléchargement gratuit interpréteur Perl - -- INSTALL PERL FOR WINDOWS XP Installer perl pour Windows XP - -- apache2 configure cgi apache2 configurer CGI - -- Perl interpreter for windows XP Interpréteur Perl pour Windows XP - -- all tous - -- how to install perl on vista comment installer perl sur Vista - -- perl interpreter free download Perl interprète téléchargement gratuit - -- perl for xp Perl pour Windows XP - -- install perl windows xp Perl installer Windows XP - -- perl interpreter vista Perl interprète Vista - -- windows xp cgi Windows XP CGI - -- how to install perl in windows xp comment installer perl sous Windows XP - -- perl download for xp Perl télécharger pour Windows XP - -- apache perl configuration Perl de configuration Apache - -- perl.exe free download perl.exe téléchargement gratuit - -- install perl on xp installer Perl sur XP - -- how to configure cgi comment configurer CGI - -- perl exe download exe Perl télécharger - -- perl setup Perl configuration - -- enable cgi in apache2 permettre à CGI dans apache2 - -- apache2 allow cgi apache2 permettre CGI - -- Free Download Perl for Windows XP Téléchargement gratuit de Perl pour Windows XP - -- perl interpreter for vista interpréteur Perl pour Windows Vista - -- perl for windows XP download Perl pour Windows XP télécharger - -- apache2 perl setup Perl configuration apache2 - -- apache2 configure perl apache2 configurer Perl - -- how to install perl on windows vista comment installer Perl sur Windows Vista - -- Perl Windows XP Perl Windows XP - -- perl setup for windows Perl installation pour Windows - -- perl windows configuration Perl configuration de Windows - -- download perl exe exe télécharger Perl - -- download perl Windows XP Perl télécharger Windows XP - -- configure perl apache2 Perl configurer apache2 - -- enable cgi on apache permettre à CGI sur Apache - -- xampp perl configure xampp configurer Perl - -- free perl download for Windows XP perl télécharger gratuitement pour Windows XP - -- "perl for vista" "Perl pour Windows Vista" - -- how to install perl on xp comment installer Perl sur xp - -- perl windows install Windows installer Perl - -- How to Configure Perl in Windows Comment configurer Perl sous Windows - -- xampp enable cgi XAMPP permettre CGI - -- apache2 cgi configuration CGI configuration apache2 - -- perl download windows xp Perl télécharger Windows XP - -- perl configure Perl configurer - -- perl interpreter windows vista Perl interprète Windows Vista - -- configure cgi apache2 CGI configurer apache2 - --