Project

General

Profile

Actions

Bug #2332

closed

PATH variable in environment emptied when running a perl script via mod_cgi

Added by Mithaldu over 13 years ago. Updated almost 9 years ago.

Status:
Invalid
Priority:
Normal
Category:
mod_cgi
Target version:
-
ASK QUESTIONS IN Forums:

Description

On Windows XP, i run this version of Lighty: http://files.wlmp-project.net/pub/WLMP-Project/LightTPD-Win32/LightTPD-1.4.28-1-Win32-SSL.zip

I am using mod_cgi to run the attached perl script via through ActivePerl. The path in the output ends up like this:

'PATH' => 'Ÿ$Ÿ$',

This is problematic because there does not seem to be a way to copy the system path into my script's environment via lighttpd.

Please either ensure this is copied, or provide a way to do so via the config.


Files

path_test.cgi (83 Bytes) path_test.cgi Mithaldu, 2011-08-05 14:27
Actions #1

Updated by Mithaldu over 13 years ago

The same thing happens when the script is run on a Debian box: http://cat.eatsmou.se/path_test.cgi

Path isn't even weird there, it's flat out missing.

Actions #2

Updated by Mithaldu over 13 years ago

As suggested by icy on IRC, a workaround is:

server.modules = ( "mod_setenv" )
setenv.add-environment = ( "PATH" => env.PATH )
Actions #3

Updated by gstrauss almost 9 years ago

I believe it is intentional that mod_cgi constructs a CGI environment without any implicit inheritance from the lighttpd server environ.

Yes, anything additional that you would like to set in the CGI environment, such as explicit PATH, can be set with mod_setenv.

Actions #4

Updated by stbuehler almost 9 years ago

  • Status changed from New to Invalid

Mithaldu wrote:

... or provide a way to do so via the config.

You did so yourself in the meantime.

Actions

Also available in: Atom