Opened 14 years ago

Closed 13 years ago

#4462 closed patch (fixed)

mythweb Perl components not working with lighttpd

Reported by: anonymous Owned by: xris
Priority: minor Milestone: unknown
Component: mythweb Version: unknown
Severity: medium Keywords: lighttpd
Cc: Ticket locked: no


For reasons unknown, lighttpd converts all cgi (but not fastcgi) environment variable names to uppercase. This was reported to lighttpd devs 2 years (!) ago, but the issue seems to be ignored (see

The attached patch makes mythweb work properly with lighttpd.

Attachments (2)

mythweb-lighttpd-envvar.patch (672 bytes) - added by mans@… 14 years ago.
make work with lighttpd (498 bytes) - added by greg-mythtvtrac@… 13 years ago.
still doesn't work - another fix

Download all attachments as: .zip

Change History (10)

Changed 14 years ago by mans@…

make work with lighttpd

comment:1 Changed 13 years ago by Rob Smith

Status: newinfoneeded_new

Won't this break non-lighttpd installs?

comment:2 Changed 13 years ago by xris

(In [16104]) Add a workaround for a lighttpd cgi bug. re #4462

comment:3 Changed 13 years ago by xris

Resolution: fixed
Status: infoneeded_newclosed

(In [16105]) r1614 from trunk: Add a workaround for a lighttpd cgi bug. closes #4462

comment:4 Changed 13 years ago by mans@…

Resolution: fixed
Status: closednew

This still doesn't work properly. Changing the $ENV{...} references to use uppercase as in the first patch, together with the checked-in change, should work with any web server.

comment:5 Changed 13 years ago by xris

How doesn't it work? the changeset basically creates an uppercase version of each environment variable, alongside the lower case one. I can't change the vars to upper case in the apache config because it would break every existing mythweb install and piss off a bunch of users.

comment:6 Changed 13 years ago by mans@…

The problem is that lighttpd converts all environment variable names to uppercase before assigning them. For example, setenv.add-environment = ( "db_server" => "hostname" ) sets the environment variable DB_SERVER to the value hostname. Your change copies any environment variables with lowercase names to new variables with uppercase names, but the lowercase names are the ones that are missing, and the code still tries to access the variables by lowercase names. In other words, the change has no effect under lighttpd. If my original patch is applied on top of your change, the code will work with both web servers, since Apache-assigned lowercase variables will be mapped to uppercase, and lighttpd sets only uppercase names.

comment:7 Changed 13 years ago by anonymous

Could map all vars to lowercase

comment:8 Changed 13 years ago by Rob Smith

Resolution: fixed
Status: newclosed

(In [17587]) Fixes #4462, makes a lower case copy of all the env vars so lighthttpd will work correctly

Changed 13 years ago by greg-mythtvtrac@…

Attachment: added

still doesn't work - another fix

Note: See TracTickets for help on using tickets.