Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: enviroment variables do not work when cgi saved as image/png

by steves (Curate)
on Dec 18, 2004 at 14:55 UTC ( #415861=note: print w/ replies, xml ) Need Help??


in reply to enviroment variables do not work when cgi saved as image/png

If this works from the command line, but not as a CGI, and the issue is missing environment variables, I would first check your web server. You have to take special measures (i.e., configuration) to have a web server set environment variables that a CGI sees. The simple place to start is to write a CGI script -- not even necessarily Perl -- that shows what your environment is when the CGI is invoked. Apache comes with this printenv CGI script (written in Perl of course!):

#!/usr/local/bin/perl ## ## printenv -- demo CGI program which just prints its environment ## print "Content-type: text/plain\n\n"; foreach $var (sort(keys(%ENV))) { $val = $ENV{$var}; $val =~ s|\n|\\n|g; $val =~ s|"|\\"|g; print "${var}=\"${val}\"\n"; }


Comment on Re: enviroment variables do not work when cgi saved as image/png
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://415861]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2015-07-28 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls