logo       

Re: Please help: PHP4/postgres db woes: msg#00017

Subject: Re: Please help: PHP4/postgres db woes
On Fri, 5 Mar 2004, Danny O'Brien wrote:

> Any postgre experts out there? We have a PHP4 site that worked fine 
> under a previous RedHat build, but we just can't get it working on this 
> Debian build.
> 
> Here's what we're running:
> 
> Debian 3.0r1 "woody"
> Kernel 2.4.18-bf2.4
> Apache 1.3.26-0woo
> postgres 7.2.1-2wood
> php 4.1.2-6wood

If you can upgrade the above to the latest, that would be a good thing.  
Especially postgresql.  At the very least, upgrade postgresql to 7.2.5 or 
whatever the last version of 7.2 was.

> We've applied a script sent to us by the original programmers, that 
> installed several logins and passwords.
> But when we go to login to our PHP site, our login is rejected.

How are logins handled, via apache authentication, or custom PHP code?

do you mean apache / web site authentication, or pgsql authentication is 
failing?

> I've taken the following actions:
...
> 3) Altered the pg_hba.conf (located in /etc/postgresql) to reflect the 
> following, and re-started postgre:
> 
> #local        all                                           ident 
> sameuser
> local        all                                           trust
> host         all         127.0.0.1     255.0.0.0           ident 
> sameuser
> host         all         0.0.0.0       0.0.0.0             reject

You might want to try setting it to just trust on local and host 
127.0.0.1/255.0.0.0 for testing to see if that lets you in.

> 4) Made sure that the php4-pgsql module is present  -- I did an 
> "apt-get" for this last week

If you make a simple page that has this in it:

<?php
phpinfo();
?>

what do you get (look in the apache httpd.conf file for the extensions 
php is setup to handle.  you may need to edit this and restart apache.

> 5) Examined the postgres.log for clues -- the log file is empty, 
> indicating that no login attempts have been made -- I suppose because 
> the auth.php has not found the DB?

If auth.php is not finding the db, what kind of error is it giving.  
More details make it easier to troubleshoot your problem.

> 6) pg_exec call deprecated under PHP 4.2.0 and replaced with pg_query: 
> since we're using php 4.1.2-6wood, it seems that this does not apply to 
> our setup. Correct?

Not a problem.  While the function name is deprecate, it is still 
supported, at least through php 4.3.4, which I'm running on my 
workstation:

$ php -v
PHP 4.3.4 (cli) (built: Dec  4 2003 11:34:30)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
$ php -q
<?php
pg_exec();
?>
PHP Warning:  Wrong parameter count for pg_exec() in - on line 2

Warning: Wrong parameter count for pg_exec() in - on line 2

So it sees it as a valid command.

> All suggestions welcome. Solution guaranteed posted to the list.

Post your error messages.


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe