Please bottom post....

Tony Frasketi wrote:
> I've had problems with this in this the past and found your solution to
> work as long as I run my script from the bash command line.
> 
> However if the script is run from a web page, I still do not get the
> value of the environment variable that I had set from the bash prompt or
> even in the .profile file. Can you  shed some light on why the variables
> do not show up on the web page?
> TIA
> tony
> 

The key is what environment the script inherits from. In the case of
your script running from the command line it is inheriting the
environment of the shell, so your .profile and soft settings are
inherited. But when run as CGI it is inheriting the environment of the
web server, which generally controls the environment closely. Most web
servers I suspect, and know Apache does for sure, allow you to add
arbitrary environment settings in the configuration.

See: http://httpd.apache.org/docs/1.3/env.html

This is the same reason why there are user permission/ownership
requirements, because your script isn't running (necessarily) as who
created it, but is instead running as the user running the webserver
(often nobody/apache/www).  The same applies when doing forking
operations from within your script, the fork inherits the same
environment as your Perl script, and so on...

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


  • Re: %ENV Tony Frasketi
    • Re: %ENV Wiggins d'Anconia

Reply via email to