Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^9: DBI placeholders for spatial data

by afoken (Chancellor)
on Jul 01, 2021 at 05:48 UTC ( [id://11134524]=note: print w/replies, xml ) Need Help??


in reply to Re^8: DBI placeholders for spatial data
in thread DBI placeholders for spatial data

I guess because the DBI environment variables are not available to me on the shared hosting!

There is a script in my cgi-bin which lists all the CGI environment variables and there is nothing helpful in there. When I connect by SSH and run perl -e 'foreach $k(keys %ENV){print "$k - $ENV{$k}\n";}' I get environment variables for SSH and for local PERL and other directories but nothing relating to DBI

Of course you won't see the web server environment variables when running code from an SSH shell.

So, as it is hidden from me by the server admins, I can only guess...

Nonsense. When you run from the web server, i.e. a CGI or something running via mod_perl, you will see exactly the same variables as Perl. There is no way to hide anything. If DBI can see an environment variable, so can any other perl code started by the web server.

Depending on how your shared hosting is configured, your CGIs may actually be run via mod_perl, using ModPerl::Registry. Loading Apache::DBI from the webserver may also happen. That changes how DBI->connect() works, as documented in Apache::DBI. The documentation also gives a hint how to detect that situation: $ENV{'MOD_PERL'} is set and $INC{'Apache/DBI.pm'} should exist.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-23 07:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found