跳轉到內容

IIS 和 FastCGI/指令碼語言/Perl/Catalyst

來自華夏公益教科書,開放的書籍,用於開放的世界

這是 Catalyst 和 FastCGI 的快速概述。 假設您已經註冊瞭解釋器

在 Catalyst 5.7014 和 5.7015 上測試。

fcgiext.ini 中的 Stansa

[編輯 | 編輯原始碼]

確保您擁有以下內容

[Catalyst]
ExePath=C:\strawberry\perl\bin\perl.exe
; The -e is important, this flag tells MyApp_fastcgi.pl to change the way it treats stderr
Arguments="D:\Inetpub\www\DMApp\script\MyApp_fastcgi.pl -e"

; these three lines tell it to always let Cat handle requests.
IgnoreDirectories=1
IgnoreFiles=1
IgnoreExistingFiles=1

; these three lines you can muck with for performance/resource optimizations
QueueLength=999
MaxInstances=20
InstanceMaxRequests=500

編輯 MyApp_fastcgi.pl

[編輯 | 編輯原始碼]

由於 MyApp_fastcgi.pl 在上述中接受引數 (-e),因此現在不再需要此步驟

在編寫本文時,某些早期版本(仍然存在錯誤)需要對 stderr 進行修改才能在 Windows 上執行。 您需要對 MyApp_fastcgi.pl 進行更改。

更改顯示 keep_stderr 的行

 
DMApp->run(
    $listen,
    {   nproc   => $nproc,
        pidfile => $pidfile,
        manager => $manager,
        detach  => $detach,
  keep_stderr => $keep_stderr,
    }
);

更改為1:

 
DMApp->run(
    $listen,
    {   nproc   => $nproc,
        pidfile => $pidfile,
        manager => $manager,
        detach  => $detach,
        keep_stderr => 1,
    }
);
華夏公益教科書