pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: phawkins@connact.com
To: pgsql-admin@hub.org
Subject: Re: Perl Script and Postgres DB running via Apache Web Server
Date: Tue, 29 Feb 2000 00:04:51 -0500
Message-ID: <1116-Tue29Feb2000000451-0500-phawkins@connact.com> (raw)
In-Reply-To: <200002290401.XAA04949@hub.org>
References: <200002290401.XAA04949@hub.org>


One:
su root
su - nobody
Cd to the appropriate directory.  Run the script.  What happens?

Two: (If that didn't help) Do the CGI magic to make the browser
display the environment variables set for the CGI script.  Su to
nobody (as above) and set all the env variables (and I mean all of
them, including HOME) the same as for the browser.

Run the script.  What happens?

Three: If you got a failure, then su to nobody, and set all the env
variables identically to those of the user (or situation) for which
the script works.  Run the script.

Four:  Change them one by one, running the script each time.

Modify algorithm as necessary as illumination strikes.  Take careful
notes. 

Be wary of init files in home directories.

>>>>> "p" == pgsql-admin-digest  <owner-pgsql-admin-digest@hub.org> writes:

p> Date: Sun, 27 Feb 2000 17:27:29 -0700
p> From: Carla J Breuker <carlajb@juno.com> 
p> Subject: Perl Script and Postgres DB running via Apache Web Server

p> Hi...

p> I have the following Perl Script (with Postgres code):

p> 	#!/usr/bin/perl -w
p> 	use Pg;

p> 	print "<HTML><P>This is a test</HTML"

p> 	$conn = Pg::connectdb("dbname=test");
p> 	$conn->exec("insert into test_table values ('Carla', '90')");

p> This Script will run from the command line, and inserts values into the
p> existing DB and table.
p> When it is run via the web browser, nothing happens (browser hangs).

p> The script is in the /usr/local/httpd/cgi-bin directory, owned by a user
p> (not root), and has 755 permissions.

p> We have exhaustively searched perl, cgi, postgres, and apache
p> documentation both printed and web-based,
p> and cannot determine how to correct this problem.

p> We suspect that it may be a permissions / execution rights for the httpd,
p> but we are stumped.

p> Any help will be greatly appreciated.

p> Thanks,
p> 	-Carla and Chris :)
p> ________________________________________________________________
p> YOU'RE PAYING TOO MUCH FOR THE INTERNET!
p> Juno now offers FREE Internet Access!
p> Try it today - there's no risk!  For your FREE software, visit:
p> http://dl.www.juno.com/get/tagj.

p> ------------------------------

p> End of pgsql-admin-digest V1 #463
p> *********************************


p> ************





view thread (4+ messages)  latest in thread

Message-ID: <1116-Tue29Feb2000000451-0500-phawkins@connact.com>
Permalink:  ../1116-Tue29Feb2000000451-0500-phawkins@connact.com/
Also on:    postgresql.org/message-id/1116-Tue29Feb2000000451-0500-phawkins@connact.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: phawkins@connact.com, pgsql-admin@hub.org
  Subject: Re: Perl Script and Postgres DB running via Apache Web Server
  In-Reply-To: <1116-Tue29Feb2000000451-0500-phawkins@connact.com>
  References: <200002290401.XAA04949@hub.org> <1116-Tue29Feb2000000451-0500-phawkins@connact.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox