Ticket #1269 (new defect)

Opened 1 year ago

Last modified 1 year ago

fastcgi.map-extensions doesn't work / odd static behavior

Reported by: mike503 Assigned to: jan
Priority: normal Milestone: 1.4.20
Component: mod_fastcgi Version: 1.4.15
Severity: normal Keywords: fastcgi, static, map
Cc: Blocking:
Need Feedback: 0

Description (Last modified by jan)

i am trying to parse .htm files as .php for a client.

CONFIG 1:

$HTTP["host"] =~ "^foo\.com$" {
 server.document-root = "/home/mark/web/foo.com"
static-file.exclude-extensions = ( ".php", ".pl", ".cgi", ".htm" )
fastcgi.debug = 1                          
debug.log-request-handling = "enable"
fastcgi.map-extensions = ( ".htm" => ".php" )
 fastcgi.server = (
".php" =>
 (
  (
   "host" => "127.0.0.1",
   "port" => 10511,          
   "broken-scriptfilename" => "enable"
  ))
 )
}

CONFIG 2:

$HTTP["host"] =~ "^foo\.com$" {
 server.document-root = "/home/mark/web/foo.com"
static-file.exclude-extensions = ( ".php", ".pl", ".cgi", ".htm" )
fastcgi.debug = 1                          
debug.log-request-handling = "enable"
 fastcgi.server = (
".php" =>
 (
  (
   "host" => "127.0.0.1",
   "port" => 10511,          
   "broken-scriptfilename" => "enable"
  )),
".php" =>
 (
  (
   "host" => "127.0.0.1",
   "port" => 10511,          
   "broken-scriptfilename" => "enable"
  ))
 )
}

the output from config 1 is below. config 2 actually says it is dispatching to fastcgi, but it does not process PHP still. if i am missing something here please let me know, but it appears to be a bug. it keeps wanting to treat .htm as static, but when i tell it to use fastcgi explicitly, it looks like it tries to, but it doesn't seem to parse it properly. should be easy enough to reproduce/fix.

2007-07-26 01:03:50: (response.c.202) -- splitting Request-URI 
2007-07-26 01:03:50: (response.c.203) Request-URI  :  /test.htm 
2007-07-26 01:03:50: (response.c.204) URI-scheme   :  http 
2007-07-26 01:03:50: (response.c.205) URI-authority:  www.foo.com 
2007-07-26 01:03:50: (response.c.206) URI-path     :  /test.htm 
2007-07-26 01:03:50: (response.c.207) URI-query    :   
2007-07-26 01:03:50: (response.c.257) -- sanatising URI 
2007-07-26 01:03:50: (response.c.258) URI-path     :  /test.htm 
2007-07-26 01:03:50: (response.c.372) -- before doc_root 
2007-07-26 01:03:50: (response.c.373) Doc-Root     : /home/mark/web/foo.com 
2007-07-26 01:03:50: (response.c.374) Rel-Path     : /test.htm 
2007-07-26 01:03:50: (response.c.375) Path         :  
2007-07-26 01:03:50: (response.c.423) -- after doc_root 
2007-07-26 01:03:50: (response.c.424) Doc-Root     : /home/mark/web/foo.com 
2007-07-26 01:03:50: (response.c.425) Rel-Path     : /test.htm 
2007-07-26 01:03:50: (response.c.426) Path         : /home/mark/web/foo.com/test.htm 
2007-07-26 01:03:50: (response.c.443) -- logical -> physical 
2007-07-26 01:03:50: (response.c.444) Doc-Root     : /home/mark/web/foo.com 
2007-07-26 01:03:50: (response.c.445) Rel-Path     : /test.htm 
2007-07-26 01:03:50: (response.c.446) Path         : /home/mark/web/foo.com/test.htm 
2007-07-26 01:03:50: (response.c.463) -- handling physical path 
2007-07-26 01:03:50: (response.c.464) Path         : /home/mark/web/foo.com/test.htm 
2007-07-26 01:03:50: (response.c.471) -- file found 
2007-07-26 01:03:50: (response.c.472) Path         : /home/mark/web/foo.com/test.htm 
2007-07-26 01:03:50: (response.c.610) -- handling subrequest 
2007-07-26 01:03:50: (response.c.611) Path         : /home/mark/web/foo.com/test.htm 
2007-07-26 01:03:50: (mod_staticfile.c.386) -- handling file as static file 
2007-07-26 01:03:50: (response.c.622) -- subrequest finished

Attachments

Change History

07/26/2007 03:38:59 PM changed by jan

  • description changed.

07/26/2007 03:52:05 PM changed by mike503

that second .php was .htm :)

keeping it simple and only using fastcgi.map-extensions actually sends the request to mod_fastcgi, but the php code is not executed.

07/26/2007 04:32:09 PM changed by mike503

it appears if compress is enabled for some reason it does not process php.

doing this: compress.filetype = ( )

in the $HOST stanza makes it work... from what i can tell a debug request log doesn't help me determine why though.

07/27/2007 07:45:16 AM changed by Olaf van der Spek

it appears if compress is enabled for some reason it does not process php.

In what order did you load the compress and fastcgi modules? Tried the other order?


Add/Change #1269 (fastcgi.map-extensions doesn't work / odd static behavior)




Change Properties