| From: | Barker <barkerds(at)snybufaf(dot)buffalostate(dot)edu> | 
|---|---|
| To: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Warning: PostgreSQL query failed: ERROR: [my_tabel]: Permission denied in [my_php_program] | 
| Date: | 2002-08-09 10:46:58 | 
| Message-ID: | Pine.OSF.4.05.10208090643570.17012-100000@snybufaf.buffalostate.edu | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Can someone tell me why my PHP command [pg_exec ($database, $line );]
causes the "Permission denied" error.
I am trying to use PostgreSQL 7.2, PHP4, and Web-based apache user
I have focused on pg_hba.conf; -i option; and making sure that
user apache is a valid Unix user.
I have included the parts that may be helpful.
------------------------
Error Message:
octave ... INSERT INTO use VALUES ('2002-08-08', '18:04:34',
'136.183.17.43', '3222', 'Mozilla/4.72
[en] (X11; U; Linux 2.2.14-5.0 i686)' );
Warning: PostgreSQL query failed: ERROR: use: Permission denied. in
/var/www/html/octave/A2.php
on line 113
-----------------------
A2.php:  (lines 112 & 113)
       print("$dbName ... $line<p>");    /* TEST */
       pg_exec ($database, $line );
------------------------------------
pg_hba.conf:
host   all     0.0.0.0 0.0.0.0 trust
host       all         127.0.0.1     255.255.255.255    trust
local   all                     trust
------------------------------------
/etc/rc.d/init.d/postgresql:
su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -o "-i"  -D $PGDATA -p
/usr/bin/postmaster start  > /dev/null 2>&1" < /dev/null
-------------------------------------
firewall off
-----------------------
Proof that apache user is authorized as a Unix user:
bash-2.05a$ psql -U apache octave
Welcome to psql, the PostgreSQL interactive terminal.
Type:  \copyright for distribution terms
       \h for help with SQL commands
      \? for help on internal
       \g or terminate with semicolon to execute query
       \q to quit
-----------------------------
Thanks,
Steve Barker
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nigel J. Andrews | 2002-08-09 11:12:43 | Re: The standard 'why does it take so long' question | 
| Previous Message | Nigel J. Andrews | 2002-08-09 10:12:55 | Re: [HACKERS] Linux Largefile Support In Postgresql RPMS |