Install, Setup and Configure CGI and Perl in Windows XPインストールすると、セットアップおよび構成のCGIとperlでは、 Windows XP
Prerequisite 前提条件
Obvioulsy, a web server needs to be running on the Windows machine. obvioulsy 、あるウェブサーバーにする必要がありますWindowsマシン上で実行されています。 Refer to thisを参照して、この postポスト for instructions on how to install Apache2 in Windows. apache2のをインストールする方法についての説明をされています。
Download ActivePerl ダウンロードにActiveState
Download ActivePerl from ActiveStateのダウンロード http://www.activestate.com/Products/ActivePerl/?mp=1 http://www.activestate.com/products/activeperl/?mp=1 .です。 Click on Free Download to start the download process.無料でダウンロードをクリックしてダウンロードを開始するに処理します。 There is no need to input any contact info.には任意の連絡先情報を入力する必要はありません。 Just leave it blank and press ‘Next’ to start the download.空白のままだけを押して[次へ]ダウンロードを開始します。
Then download the lastest version of Windows MSI package.最新のバージョンのWindowsを入力し、ダウンロードしてMSIパッケージです。
Install ActivePerl インストールにActiveState
Start the installation by double clicking the setup file.起動してインストールをダブルクリックして、セットアップファイルです。 Follows the on-screen 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.する場合はPerlのCGIプログラムを使用して、いくつかのレベルの可搬性を維持したいの間にLinuxマシンとWindowsの両方のマシンでは、をインストールすることができますPerlのは、同じ場所をWindowsマシンに、これはほとんどの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 .たとえば、 Linuxマシン、 Perlはそれは/ usr / bin / perlを、したがって、すべてのPerlのプログラムを書いている今から始まります# ! / 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.したがって、 Perlの上で最高のWindowsマシンにインストールするときに、それをインストールする代わりに、デフォルトの場所(例えばC : \ Perlの) 、インストールすることではC : \ usr代わりに、 Perlのように、実行ファイルがある場所は/ 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.これにより、コードを書いてWindowsマシンに移行され、変更せずにLinuxマシン、それを実行して存在し、逆も可能です。
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.インストールパスを変更するには、 [参照]ボタンをクリックしているときには、インストールを促すメッセージが表示画面を選択するにはをインストールする機能を選択します。 Set it to C:\usr\ if needed.設定することをc : \ usr \場合に必要です。
Make sure that the following options is checked (selected):ことを確認して、以下のオプションがチェック(選択) :
Add Perl to the PATH environment variable Perlの環境変数のパスを追加
Create Perl file extension association Perlのファイルの拡張子を作成協会
Activating CGI 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. httpd.confファイルを開いて編集を選択しスタート]ボタン> "プログラム" >のApache HTTPサーバ" >構成Apacheのサーバ" >編集してApacheのhttpd.confの設定ファイルです。 Alternatively, open the httpd.conf with any text editor.また、任意のテキストエディタで開いてhttpd.confのです。
In the main directory section, search for Options Indexes FollowSymLinks (at about line 267), and add ExecCGI to the end so it looks like:ディレクトリのメインセクションでは、検索オプションのインデックスfollowsymlinks (約267行) 、および追加の最後にexeccgiので、次のように:
Options Indexes FollowSymLinks ExecCGIオプションのインデックスfollowsymlinks execcgi
Search for the following line and remove the hash mark character (#) to uncomment this line.検索すると、次の行の文字を削除してハッシュマーク( # )をこの行のコメントを外してください。 (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: (変更することもできます。のCGIをします。ポーランド語、または追加します。ポーランド語の後ろです。 PerlのCGIのことを推奨して拡張する場合もCGIファイルとして扱われます)例:
#AddHandler cgi-script .cgi # addhandler CGIスクリプトです。のCGI
Should look like:は、次のよう:
AddHandler cgi-script .cgi .pl addhandler CGIスクリプトです。 CGIで提供します。ポーランド語
orまたは
AddHandler cgi-script .pl addhandler CGIスクリプトです。ポーランド語
orまたは
AddHandler cgi-script .cgi addhandler CGIスクリプトです。のCGI
Save the httpd.conf configuration file, restart the Apache server. httpd.confの設定ファイルを保存して、 Apacheサーバを再起動してください。 Test the configuration as described in Testing Your Web Server CGI Configuration at the end of this article.テストの設定に記載され、ウェブサーバーのCGIの設定のテストの最後には、次の資料です。
Optional: Enabling CGI in Any Directory オプション:任意のディレクトリのcgiを有効に
If you want to use CGI outside ScriptAliased directory (ScriptAlias is usually the Apache2/cgi-bin/), comment out the following line:外部のCGIを使用したい場合はscriptaliasedディレクトリ(設定ScriptAliasは、通常、 apache2/cgi-bin / ) 、次の行をコメントアウトして:
ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/”設定ScriptAlias / cgi - binに/ " c : /プログラムファイル/ Apacheのgroup/apache2/cgi-bin / "
Should look like:は、次のよう:
#ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/” #設定ScriptAlias / cgi - binに/ " c : /プログラムファイル/ 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.また、 1つだけを指定したい場合は、すべてのCGIプログラムのディレクトリを置く、パスを変更する代わりに、しかし、そのディレクトリにユーリに存在しています。
Should look like (for default settings):は次のように(デフォルト設定) :
ScriptAlias /cgi-bin/ “your_prefer_cgi-bin_direcotry”設定ScriptAlias / cgi - binに/ " your_prefer_cgi - bin_direcotry "
Save the httpd.conf file. httpd.confファイルを保存しています。 Restart the Apache server. Apacheサーバを再起動してください。
Finding Perl Executable Location perl実行ファイルの場所を見つける
If you don’t know where is perl.exe installed to, go to Start -> Search and search for perl.exe.がわからない場合は、インストールされてperl.exeはどこにするには、スタート" ->検索ページと検索をp erl.exeです。 This location is the path to the perl executable that has to be put on the top of all cgi scripts.この場所は、 perl実行ファイルのパスを指定しての上に置くのすべてのCGIスクリプトです。 If you follow default installation procedure, the path should be C:/perl/bin/perl.exe次のデフォルトのインストール手順をする場合は、パスにはC : / perlを/ビン/ perl.exe
For the path to perl.exe path, all of these format are valid: perl.exeへのパスをパスを、これらのすべての形式が有効である:
#!c:/perl/bin/perl.exe # ! c : / perlを/ビン/ perl.exe
#!c:/perl/bin/perl # ! c : / perlを/ bin / perlを
#!/perl/bin/perl.exe # ! / perlを/ビン/ perl.exe
#!/perl/bin/perl # ! / perlを/ bin / perlを
Testing Your Web Server CGI Configuration テストしてWebサーバーの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:割引率は、次のテストスクリプトにしてDocumentRootディレクトリ(設定ScriptAliasのコメントを外している場合は、任意の場所に置くことができるとしてDocumentRootディレクトリの中か、または設定ScriptAliasを設定する場合は、いくつかの特定のディレクトリ、そのディレクトリに置くだけのcgiをする、すなわちapache2/cgi-ビン)としてtest.plまたはtest.cgi ( addhandlerの設定によっては、このライン)と、必要に応じて変更して最初の行にActiveStateをポイントするようにして通訳:
#!c:\perl\bin\perl.exe # ! c : \ Perlの\ binに\ perl.exe
# ^^^ this must be the first line of the script! # ^ ^ ^このしなければならないのスクリプトの最初の行に! ^^^ ^ ^ ^
# start code #スタート]ボタンをコード
use strict;使用厳格な;
use CGI;使用のCGI ;
my $q = new CGI;マイ$問=新規のCGI ;
# print header and start the markup output #印刷ヘッダーとスタート]ボタンを使用するマークアップの出力
print $q->header( “text/html” ),$q->start_html( “hello from perl cgi!” );印刷$問- >ヘッダー(の" text / html " ) 、 $問- > start_html ( "ハローよりPerlのCGI ! " ) ;
print $q->h2(”hello dave…”);印刷$問- >水素( "ハローデイブ… " ) ;
print $q->end_html;印刷$問- > end_html ;
# end code #終了コード
Now go to今すぐに行く http://localhost/cgi-bin/test.cgi (scripts in Apache2/cgi-bin/ are read as http://localhost/cgi-bin/ by default). (スクリプトをapache2/cgi-bin /デフォルトでは読み取りとしてhttp://localhost/cgi-bin/ ) 。 You should see a page that displays a level two heading with the following text:を表示するページが表示されるはずのレベル2つの見出しは、次のテキスト:
hello dave ハローデイヴ
If you see the above message, CGI is running.詳細については、上記のメッセージが表示する場合、 CGIが実行中です。 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.取得する場合に500エラーが発生するには、 apache2/logs/error.logの最後のエントリにして(または[スタート]メニューエラーログに記録した日)を参照し正確には何が原因このエラーが発生します。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これは、機械翻訳ページで提供"現状有姿"を保証します。 Machine translation may be difficult to understand.機械翻訳を理解するのは難しいかもしれません。 Please refer toを参照してください original English articleオリジナルの英語記事索引 whenever possible.いつ可能です。
Share and contribute or get technical support and help atを共有して貢献や技術サポートとヘルプを得る My Digital Life Forums 私のデジタルライフフォーラム .です。
Related Articles関連記事
- Install AWStats- Free Logfile Analyzer for Site Statistics awstats -無料のログファイルアナライザをインストールするサイトの統計情報
- Easily Set Up Web Server with XAMPP XAMPPのウェブサーバーを簡単にセットアップする
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4ウェブサーバーでは、 Windows XPをインストールするのApache2 、 PHP5とmysql4 -パート4
- CPAN Missing Parameter auto_commit Message行方不明のパラメータauto_commitメッセージが表示さcpan
- Internal Error 2739 Error in Vista (32 or 64-bit) When Install Adobe Photoshop CS3 and Reflector Related Programs内部エラーが発生しました2739にエラーが発生ビスタ( 32または64ビット)と反射鏡cs3 Adobe Photoshopのインストール時に関連したプログラム
- Enable and Display Security Tab in Windows XP Home Edition [セキュリティ]タブの表示を有効にしてWindows XP Home Editionで
- eMule 0.48a for Windows Vista Free Download emule 0.48a for Windows Vistaの無料ダウンロード
- Hack and Workaround to Clean or Fresh Install Windows Vista with Upgrade License DVDハックと新鮮な回避策をきれいにWindows VistaのインストールとアップグレードまたはライセンスDVD
- Trick to Install Windows XP SP3 RC in Non-English Language EditionsトリックWindows XPをインストールするSP3のrc英語以外の言語のエディション
- Download Yahoo!ダウンロードヤフー! Messenger with Voice 8 Full Standalone Installerメッセンジャー単体インストーラによるフルボイス8

































January 2nd, 2006 02:19 2006年1月2日02:19
[...] As AWStats is Perl based, a Perl Interpreter need to be installed first to take anvantage of AWStats. [...] awstatsは、 Perlをベースとして、通訳にするPerlの最初にインストールする必要がありますanvantageのawstatsを取る。 For instruction on how to install Perl in Windows machine, check out this article.上の命令でPerlのWindowsマシンをインストールする方法については、チェックアウトこの記事です。 [...]
July 25th, 2006 20:53 2006年7月25日20:53
I have installed cgi and configured apache as you said, but i got this erro:私はApacheのインストールおよび構成のCGIによると、しかし、私はこのエラー:
Internal Server Error内部サーバーエラーが発生しました
The server encountered an internal error or misconfiguration and was unable to complete your request.サーバーで内部エラーが発生またはミスや、お客様のリクエストを完了することができませんでした。
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.ご連絡サーバーの管理者は、ウェブマスター@ localhostのとの情報を、時間にエラーが発生し、何かが原因かもしれない行うことがありますが、エラーが発生します。
More information about this error may be available in the server error log.このエラーの詳細についてはご利用可能なのはサーバーのエラーログに記録します。
——————————————————————————– ---------------------------
Apache/2.0.58 (Win32) PHP/5.1.4 Server at localhost Port 80 apache/2.0.58 ( Win32 )のphp/5.1.4サーバーにlocalhostのポート80
May 10th, 2007 19:25 2007年5月10日19:25
Cool4you,guys. cool4you 、二人とも。
June 20th, 2007 08:09 2007年6月20日08:09
Just for the record, the above test script throws a 500 error when used as is.念のためにレコードは、上記のテストスクリプトの例外が使用され、 500エラーが発生します。 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多分これはFirefoxの表示に問題があるだけのテキストか何か、しかし、二重引用符が混在するように、問題が発生につながる恐れがある
October 8th, 2007 23:05 2007年10月8日23:05
Hi all,こんにちはすべて、
I really need some help on this subject =)本当に必要ないくつかのヘルプ]をクリックこのアジ研= )
I have followed the steps above, and changed the quotation marks, and what I get is 9 error messages:私は上記の手順を実行後、および変更して二重引用符、およびどのようなエラーメッセージが表示さ私は9 :
Backslash found where operator expected at Z.\test.cgi line 1, near “rtf1\”演算子の期待にバックスラッシュが見つかりましたどこz. \ test.cgi 1行目近辺、 " rtf1 \ "
or ….または… 。 , near “ansi\”近辺、 " ansi \ "
or ….または… 。 , near “deff0″近辺、 " deff0 "
or ….または… 。 , near “f1\”近辺、 " F1の\ "
etc..等です。
I am a total rookie with these things, any help appreciated =)私はトータルルーキー、これらのものは、任意のヘルプ感謝= )
Thanks,ありがとう、
Johannaヨハンナ
November 28th, 2007 22:14 2007年11月28日22:14
I did everything you said.私はすべてのあなたと述べた。 But cgi is still not running.しかし、 CGIのはまだ実行されていません。 Please help.お助けします。
my apache is 2.2マイApacheは2.2