RE: [PHP-DB] Help, i'm really desperated
| From: | Peter Lovatt | Date: | Wed, 25 Aug 2004 10:53:15 +0000 |
| Subject: | RE: [PHP-DB] Help, i'm really desperated | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35878@lists.php.net to get a copy of this message | ||
Hi
php runs as the same user as apache. Depending on any other security/system
issues you could set apache to run as postgres.
Otherwise why not connect to postgres using the php functions and write the
text file using php?
You might also be able to su to postgres.
HTH
Peter
> -----Original Message-----
> From: Mário Gamito [mailto:gamito@netual.pt]
> Sent: 25 August 2004 11:09
> To: php-db@lists.php.net
> Subject: [PHP-DB] Help, i'm really desperated
>
>
> Hi,
>
> I need to run this command inside a PHP (web) script, in order to
> produce an acl list (url_negados.txt) for squid:
>
> /usr/bin/psql -t knet -c "SELECT url_negado from urls_negados" >
> /tmp/urls_negados.txt
>
> I'm using shell_exec to run it.
>
> Well, so far, so good.
> The problem is that i must run this command as user postgres, otherwise
> it won't work and i can't find a way to do it in PHP :(
>
> Any ideas would be appreciated.
> I'm realy desperated.
>
> Warm Regards,
> Mário Gamito
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>