Install, Setup and Configure CGI and Perl in Windows XP Instalar, instalação e configuração CGI e Perl no Windows XP

Prerequisite Pré-requisito

Obvioulsy, a web server needs to be running on the Windows machine. Obvioulsy, um servidor web precisa ser correr na máquina Windows. Refer to this Remeter para o presente post for instructions on how to install Apache2 in Windows. para instruções sobre como instalar Apache2 no Windows.

Download ActivePerl Download ActivePerl

Download ActivePerl from Download de ActivePerl http://www.activestate.com/Products/ActivePerl/?mp=1 . Click on Free Download to start the download process. Clique em Download gratuito para iniciar o processo de download. There is no need to input any contact info. Não há necessidade de introduzir quaisquer informações de contato. Just leave it blank and press ‘Next’ to start the download. Apenas deixe em branco e pressione "Next" para iniciar o download.

Then download the lastest version of Windows MSI package. Em seguida, fazer o download da versão mais recente do Windows pacote MSI.

Install ActivePerl Instale ActivePerl

Start the installation by double clicking the setup file. Inicie a instalação clicando duas vezes arquivo de configuração. Follows the on-screen instruction. Segue as instruções na tela. 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 for utilizar Perl CGI programas e querem manter um certo nível de portabilidade entre ambas as máquinas Linux e Windows máquinas, você pode querer instalar o Perl no mesmo local em sua máquina Windows, pois é na maioria das máquinas 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 . Por exemplo, a máquina Linux, Perl está localizado em / usr / bin / perl Perl e assim por cada programa que eu escrevo começa com #! / 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. Portanto, é melhor quando instalar o Perl em uma máquina Windows, em vez de instalá-la no local padrão (ou seja C: \ perl), instalá-lo em C: \ usr vez, de modo a que o Perl executável está localizado em / 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. Isto permite que códigos escritos na máquina sido transferido para o Windows, sem alterações, a máquina Linux, e têm que correr lá, e 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. Para alterar o caminho de instalação, clique no botão Procurar quando estiver na tela de instalação pede-lhe para seleccionar quais as funcionalidades que pretende instalar. Set it to C:\usr\ if needed. Configure-a para C: \ usr \ se for necessário.

Make sure that the following options is checked (selected): Certifique-se que as seguintes opções é controlada (seleccionadas):
Add Perl to the PATH environment variable Adicionar Perl para a variável de ambiente PATH
Create Perl file extension association Criar Perl extensão Associação

Activating CGI Activar 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. Abra o arquivo httpd.conf para a edição, selecionando Iniciar> Programas> Apache HTTP Server> Configurar Servidor Apache> Edite o arquivo de configuração httpd.conf Apache. Alternatively, open the httpd.conf with any text editor. Alternativamente, abra o httpd.conf em qualquer editor de texto.

In the main directory section, search for Options Indexes FollowSymLinks (at about line 267), and add ExecCGI to the end so it looks like: No diretório principal seção, busca de opções Indexes FollowSymLinks (em linha cerca de 267), e adicione ExecCGI para o fim para que ele se parece com:

Options Indexes FollowSymLinks ExecCGI Opções ExecCGI Indexes FollowSymLinks

Search for the following line and remove the hash mark character (#) to uncomment this line. Buscar a linha a seguir e remova a marca caracter hash (#) para descomentar esta linha. (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: (Você também pode mudar. Cgi para. Pl, ou acrescentar. Pl trás. Cgi se você preferir que a extensão perl também é tratada como cgi arquivos) Por exemplo:

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

Should look like: Deve ser semelhante a este:

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. Salve o arquivo de configuração httpd.conf, reinicie o servidor Apache. Test the configuration as described in Testing Your Web Server CGI Configuration at the end of this article. Teste a configuração tal como descrito no Teste o servidor web CGI configuração no final deste artigo.

Optional: Enabling CGI in Any Directory Opcional: Ativação CGI em qualquer directório

If you want to use CGI outside ScriptAliased directory (ScriptAlias is usually the Apache2/cgi-bin/), comment out the following line: Se você quiser usar CGI fora ScriptAliased diretório (ScriptAlias é normalmente o Apache2/cgi-bin /), comente as seguintes linhas:

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: Deve ser semelhante a este:

#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. Alternativamente, se você desejar apenas especificar um diretório para colocar todos os seus programas cgi, mudar o rumo vez, mas torna ure que o diretório existe.

Should look like (for default settings): Deve ser semelhante a este (para as configurações padrão):

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

Save the httpd.conf file. Salve o arquivo httpd.conf. Restart the Apache server. Reinicie o servidor Apache.

Finding Perl Executable Location Encontrar Perl executável local

If you don’t know where is perl.exe installed to, go to Start -> Search and search for perl.exe. Se você não sabe onde está instalada a perl.exe, vá para Iniciar -> Busca e pesquisa de perl.exe. This location is the path to the perl executable that has to be put on the top of all cgi scripts. Este local é o caminho para o executável perl que tem de ser colocado no topo de todos os scripts cgi. If you follow default installation procedure, the path should be C:/perl/bin/perl.exe Se você seguir procedimento instalação padrão, o caminho deve ser C: / perl / bin / perl.exe

For the path to perl.exe path, all of these format are valid: Para o caminho para perl.exe caminho, todos esses formatos são válidos:
#!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 Testando o servidor web configuração CGI

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: Salve o teste seguinte script em seu diretório DocumentRoot (se você tiver descomentar ScriptAlias, você pode colocá-lo em qualquer lugar dentro do seu diretório DocumentRoot, ou se você tiver definido ScriptAlias a alguns diretórios específica, coloque o diretório cgi, em que apenas, ou seja, Apache2/cgi- bin) ou como test.pl test.cgi (dependendo de sua configuração do AddHandler linha) e alterar a primeira linha como exige a apontar para o ActivePerl intérprete:

#!c:\perl\bin\perl.exe #! c: \ perl \ bin \ perl.exe
# ^^^ this must be the first line of the script! # ^ ^ ^ Essa deve ser a primeira linha do script! ^^^ ^ ^ ^
# start code # Começar código

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

# print header and start the markup output # Imprimir cabeçalho e iniciar a marcação de saída

print $q->header( “text/html” ),$q->start_html( “hello from perl cgi!” ); print $ q-> header ( "text / html"), US $ q-> start_html ( "hello de perl cgi!");
print $q->h2(”hello dave…”); print $ q-> h2 ( "hello dave…");
print $q->end_html; print $ q-> end_html;
# end code # Final código

Now go to Agora vá para http://localhost/cgi-bin/test.cgi (scripts in Apache2/cgi-bin/ are read as http://localhost/cgi-bin/ by default). (scripts em Apache2/cgi-bin / são entendidas como http://localhost/cgi-bin/ por padrão). You should see a page that displays a level two heading with the following text: Você deverá ver uma página que apresente um nível duas posições com o seguinte texto:

hello dave Olá Dave

If you see the above message, CGI is running. Se você ver a mensagem acima, CGI está executando. 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 você receber um erro 500, vá para a última entrada no seu Apache2/logs/error.log (ou registro de Revisão Erro no menu Iniciar) para ver exatamente o que causou este erro.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Esta é uma página traduzida máquina que é fornecida "como está" sem garantia. Machine translation may be difficult to understand. A tradução automática pode ser difícil de compreender. Please refer to Por favor, consulte a original English article Inglês original article whenever possible. sempre que possível.

Share and contribute or get technical support and help at Compartilhe e contribuir ou obter suporte técnico e ajudar a My Digital Life Forums Minha vida digital Fóruns .



6 Responses to “Install, Setup and Configure CGI and Perl in Windows XP” 6 Responses para "Instalar, instalação e configuração CGI e Perl no Windows XP"

  1. Install AWStats- Free Logfile Analyzer for Site Statistics » My Digital Life Instale AWStats-Free logfile analisador para as estatísticas do site "Minha vida digital
    January 2nd, 2006 02:19 2 de janeiro de 2006 02:19
    1

    [...] As AWStats is Perl based, a Perl Interpreter need to be installed first to take anvantage of AWStats. Tal como [...] AWStats é baseado Perl, Perl Interpreter uma necessidade de ser instalado primeiro a ter anvantage de AWStats. For instruction on how to install Perl in Windows machine, check out this article. Para instruções sobre como instalar o Perl no Windows, verifique este artigo. [...]

  2. Besart
    July 25th, 2006 20:53 25 de julho de 2006 20:53
    2

    I have installed cgi and configured apache as you said, but i got this erro: Tenho instalado e configurado cgi apache como você disse, mas eu recebi este erro:

    Internal Server Error Erro interno do servidor
    The server encountered an internal error or misconfiguration and was unable to complete your request. O servidor encontrou um erro interno ou errada e não pôde concluir o seu pedido.

    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. Entre em contato com o administrador do servidor, webmaster @ localhost e informá-los do tempo, o erro ocorreu, e você poderia ter feito alguma coisa que pode ter causado o erro.

    More information about this error may be available in the server error log. Mais informações sobre esse erro pode estar disponível no servidor erro rápida.

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

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

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

    Cool4you,guys. Cool4you, rapazes.

  4. Mitchell
    June 20th, 2007 08:09 20 de junho de 2007 08:09
    4

    Just for the record, the above test script throws a 500 error when used as is. Apenas para o registro, o teste acima script lança um erro 500 quando usado como está. 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 Talvez se trata apenas de um problema com o Firefox exibir texto ou alguma coisa, mas as aspas são confundidos, de forma que possa conduzir a problemas :)

  5. Johanna
    October 8th, 2007 23:05 Outubro 8o, 2007 23:05
    5

    Hi all, Oi todos,

    I really need some help on this subject =) Eu realmente necessitar de alguma ajuda sobre este assunto =)

    I have followed the steps above, and changed the quotation marks, and what I get is 9 error messages: Tenho seguido os passos acima, e mudaram as aspas, e aquilo que eu vejo é 9 mensagens de erro:

    Backslash found where operator expected at Z.\test.cgi line 1, near “rtf1\” Backslash operador onde esperava encontrar em Z. \ test.cgi linha 1, perto de "rtf1 \"
    or …. ou…. , near “ansi\” , Perto de "ansi \"
    or …. ou…. , near “deff0″ , Perto de "deff0"
    or …. ou…. , near “f1\” , Perto de "f1 \"
    etc.. etc.

    I am a total rookie with these things, any help appreciated =) Eu sou um novato total com essas coisas, qualquer ajuda apreciado =)

    Thanks, Obrigado,

    Johanna

  6. Munir
    November 28th, 2007 22:14 28 de novembro de 2007 22:14
    6

    I did everything you said. Eu fiz tudo o que você disse. But cgi is still not running. Cgi mas ainda não está funcionando. Please help. Por favor, ajuda.
    my apache is 2.2 O Apache é o meu 2,2

Leave a Reply Deixe uma resposta

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> Você pode usar estas tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Subscreva sem comentar


Custom Search

New Articles Novos Artigos

Incoming Search Terms for the Article Incoming Termos de pesquisa para o artigo

download perl.exe download perl.exe - -- install perl on windows xp instalar o Perl no Windows XP - -- Perl.exe download Perl.exe download - -- perl.exe perl.exe - -- apache2 enable cgi apache2 permitir CGI - -- perl apache2 Perl apache2 - -- perl for windows XP Perl para o Windows XP - -- perl vista Perl Vista - -- enable cgi apache2 permitir CGI apache2 - -- install perl on vista Perl instalar em Vista - -- how to install perl on windows XP perl sobre como instalar o Windows XP - -- configure perl configure Perl - -- perl setup download Perl setup download - -- install perl xp Perl instalar XP - -- download perl for windows xp Perl download para o Windows XP - -- PERL for windows vista PERL para Windows Vista - -- perl download for windows xp Perl download para o Windows XP - -- XAMPP Perl CGI XAMPP Perl CGI - -- xampp path to perl xampp caminho para o Perl - -- download perl setup Perl download setup - -- perl windows vista Perl Windows Vista - -- install perl vista Perl instalar Vista - -- xampp perl path xampp Perl caminho - -- free download perl.exe download gratuito perl.exe - -- perl download xp Perl download XP - -- apache2 perl apache2 Perl - -- apache2 cgi enable apache2 permitir CGI - -- configure cgi configure CGI - -- how to configure perl como configurar o Perl - -- free download perl interpreter Perl intérprete download gratuito - -- INSTALL PERL FOR WINDOWS XP Perl para instalar o Windows XP - -- apache2 configure cgi apache2 configurar CGI - -- Perl interpreter for windows XP Perl intérprete para o Windows XP - -- all todos - -- how to install perl on vista como instalar perl em vista - -- perl interpreter free download Perl intérprete download gratuito - -- perl for xp Perl para XP - -- install perl windows xp Perl instalar o Windows XP - -- perl interpreter vista Perl intérprete Vista - -- windows xp cgi Windows XP CGI - -- how to install perl in windows xp perl o modo de instalação no Windows XP - -- perl download for xp Perl download para XP - -- apache perl configuration Apache Perl configuração - -- perl.exe free download perl.exe download gratuito - -- install perl on xp Perl instalar em XP - -- how to configure cgi como configurar o CGI - -- perl exe download Perl exe download - -- perl setup Perl setup - -- enable cgi in apache2 permitir CGI no apache2 - -- apache2 allow cgi apache2 permitir CGI - -- Free Download Perl for Windows XP Free Download Perl para o Windows XP - -- perl interpreter for vista Perl intérprete para Vista - -- perl for windows XP download Perl para o Windows XP download - -- apache2 perl setup apache2 Perl setup - -- apache2 configure perl apache2 configurar Perl - -- how to install perl on windows vista perl sobre como instalar o Windows Vista - -- Perl Windows XP Perl Windows XP - -- perl setup for windows Perl configuração para Windows - -- perl windows configuration Perl configuração do Windows - -- download perl exe Perl download exe - -- download perl Windows XP Perl download Windows XP - -- configure perl apache2 configure Perl apache2 - -- enable cgi on apache permitir CGI no Apache - -- xampp perl configure xampp Perl configure - -- free perl download for Windows XP perl download gratuito para o Windows XP - -- "perl for vista" "Perl para o Vista" - -- how to install perl on xp perl sobre como instalar xp - -- perl windows install Perl instalar o Windows - -- How to Configure Perl in Windows Como configurar o Perl no Windows - -- xampp enable cgi xampp permitir CGI - -- apache2 cgi configuration apache2 configuração CGI - -- perl download windows xp Perl baixar o Windows XP - -- perl configure Perl configure - -- perl interpreter windows vista Perl intérprete Windows Vista - -- configure cgi apache2 configure CGI apache2 - --