Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: OT: would this ENV setup make you blow your lid too?

by leocharre (Priest)
on Jun 08, 2006 at 10:27 UTC ( [id://554286]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: OT: would this ENV setup make you blow your lid too?
in thread OT: would this ENV setup make you blow your lid too?

It's missing DOCUMENT_ROOT for one. Also the raw query string.

I have this simple script, that resides in cgi-bin. It gets used via an ssi include directive.

The script makes thumbnails and returns html listing thumbnail links to the larger images. It's nifty. All the user has to do is make a shtml page and put this <!--#exec cgi="/cgi-bin/gallery"-->

That one ssi call in that one page runs the whole gallery. The web designer does not need to do anything else to the page. They don't have to make new pages.

The gallery script determines where it was called from via ENV DOCUMENT_URI, or REQUEST_URI .
The thumbnails links rendered simply go to $current_http_path?file=x , where x is a number for which file is to be picked.

If "file" is set, then the gallery script knows that the request is for a picture to be shown med size, not for a view of the whole gallery.

Comments (stored with storable) and thumbnails are stored off http accessible path

Never had a problem with this on another box.

What I am showing you there is ENV straight from a perl compiled script. It's set up for php, zend. That's why it looks goofy.

Replies are listed 'Best First'.
Re^3: OT: would this ENV setup make you blow your lid too?
by derby (Abbot) on Jun 08, 2006 at 10:39 UTC

    So the ENV dump is from a cgi script via an HTTP request or the command line? (I'm still uncertain)

    -derby
Re^3: OT: would this ENV setup make you blow your lid too?
by cees (Curate) on Jun 08, 2006 at 10:42 UTC

    You do realize that when you run a perl script from a shell (ie from the command line) you will not get all of those standard CGI environment variables... It is the web server that sets those environment variables right before it executes the CGI script. When testing scripts from the command line you need to set those variables yourself, or use a module that can simulate a CGI environment like HTTP::Request::AsCGI

    The fact that your TERM environment variable is set to xterm gives it away that you ran this from the shell.

Re^3: OT: would this ENV setup make you blow your lid too?
by perrin (Chancellor) on Jun 08, 2006 at 10:49 UTC
    Oh, this was supposed to be CGI environment. I didn't get that from your post.

    Looks like the exec from your SSI just doesn't propagate the CGI environment variables, probably for security reasons. You might have better results using a #include virtual call to an actual CGI URL if your server supports it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://554286]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.