|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-30 22:20 UTC] edink@php.net
[2006-05-01 15:39 UTC] barborak at basikgroup dot com
[2007-03-03 23:54 UTC] edink@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 14:00:01 2025 UTC |
Description: ------------ (I apologize if I am reporting this in the wrong place. It seems that Shane Caraveo's fastcgi-isapi module is now being maintained as part of the PHP project. This is a great DLL for general FastCGI applications and not just PHP. The problem I found relates to using it with Perl to run dynamic servers. As such, it's not terribly relevant to your work but I thought I'd report it along with patches.) 1. When using the fastcgi-isapi DLL to run dynamic servers, the dynamic servers are running as FastCGI filters rather than responders. This is due to a structure's member not being initialized. 2. When using perl as the server executable, it is sometimes necessary to include arguments like -T and -w. The Args value in the registry is being ignored for dynamic servers. Here are the patches I applied to the code in CVS to fix these problems: --- FCGIProcMgr.cpp Thu Apr 27 14:46:38 2006 +++ FCGIProcMgr.cpp.new Thu Apr 27 14:45:54 2006 @@ -388,7 +388,10 @@ proc->incServers = parent->incServers; proc->maxServers = parent->maxServers; proc->timeout = parent->timeout; - if (path) strncpy(proc->args, path, sizeof(proc->args)-1); + proc->isFilter = parent->isFilter; + *( proc->args ) = 0; + if (parent->args) strncpy(proc->args, parent->args, sizeof(proc->args)-1); + if (path) strncpy(proc->args + strlen (proc->args), path, sizeof(proc->args)-1 - strlen (proc->args) ); strncpy(proc->bindPath, bindpath, sizeof(proc->bindPath)-1); if (dwServerImpersonate) { proc->env.putEnv("_FCGI_NTAUTH_IMPERSONATE_=1"); And I also needed this change to compile it on my machine: --- fcgi_server.h Thu Apr 27 14:46:38 2006 +++ fcgi_server.h.new Thu Apr 27 14:43:46 2006 @@ -25,6 +25,10 @@ #define FCGI_SERVER_VERSION "2.2.2 0.5.2 beta" #define FCGI_ENVIRON_VER "FCGI_SERVER_VERSION=" FCGI_SERVER_VERSION +#if !defined (INVALID_FILE_ATTRIBUTES) +#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) +#endif + extern void InitiateServers(char *szExtension); extern void CheckServers(char *szExtension); Given these changes and registry settings like the following, I was able to successfully run perl dynamic servers with the fastcgi-isapi module: HKEY_LOCAL_MACHINE\SOFTWARE\FASTCGI\.pl In this key, I added the following values: AppPath REG_SZ c:\tools\perl\5.6.1\bin\MSWin32-x86\perl.exe Args REG_SZ -T BindPath REG_SZ Note that the value of Args is "-T " (with a space). BindPath is empty. (Perhaps it's not necessary.)