Hi, I can't login in phpPgAdmin. I've installed phpPgAdmin in all the RHEL and FC distros, but in RHEL3 I can't make it work properly. I can't see any information in the RHEL3 logs, I only see a 'Login failed' error in /var/log/messages which is useless. I don't know how can I config Postgre to see useful information about the login error in phpPgAdmin.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How did you setup your conf/config.inc.php in ppa ? what about your pg_hba.conf ? server entries in conf/config.inc.php should be setted according to your pg_hba.conf...
Moreover, PostgreSQL should have its own log file (probably in /var/log/postgresql/ ?) instead of /var/log/messages.
++
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know that exists a log file in /var/log/pgsql, but it's empty, so I don't know what to do to make postgre to log in it.
I've review config files and they're correct. But I also have a doubt. I have 2 config files <ppa>/config.inc.php y <ppa>/conf/config.inc.php, which is the one that ppa uses??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
According to your pg_hba.conf file, you can login to your dbms using socket with all roles but only to access the template1 database (local template1 all md5).
Moreover, you can log as postgres using socket to access every database (local all postgres md5 ).
BUT, in ppa conf file, you have setted $conf['extra_login_security'] = true which deny postgres, admin, root (afair) roles by security.
I guess it could be your problem and ppa should inform you about that. Try to set this conf value to false.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've tried to set to false the extra_login_security and it doesn't work. The problem is that I'm not trying to log in using the postgres (root, admin, ...) user. I'm trying to log in using a normal account.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you need to either get your postgresql logging working correctly by way of postgresql.conf (which i strongly recommend regardless), or hack the line with @pg_connect in libraries/adodb/drivers/adodb-postgres64.inc.php to remove the @. In either case you should recieve a FATAL error message which should tell us much more about your problem. BTW, could you also let us know if you can login via psql and the same credentials?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've hack the line with @pg_connect and the errors shown are these:
Warning: pg_connect(): Unable to connect to PostgreSQL server: invalid connection option "sslmode" in /usr/share/phpPgAdmin-4.1.2/libraries/adodb/drivers/adodb-postgres64.inc.php on line 655
Warning: Cannot modify header information - headers already sent by (output started at /usr/share/phpPgAdmin-4.1.2/libraries/adodb/drivers/adodb-postgres64.inc.php:655) in /usr/share/phpPgAdmin-4.1.2/classes/Misc.php on line 372
Any idea??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
GREAT!!! FINALLY, it works!!! The problem was sslmode option that was set to 'allow'. I have set this option to 'disable' and it have worked.
So thanks a lot for your help, Robert and Guillaume!!!
Now, I only have a doubt. Why does the sslmode='allow' option work correctly in RHEL4 and RHEL5, but it doesn't in RHEL3??? Can I connect PG using SSL or not??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I presume RHEL3 contains the older postgresql libraries that don't support the various host options, and your postgres support inside php is compiled to those libraries. We've seen this happen to some other folks, though haven't been able to put together a solid fix that works for everyone.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I confirm this fact! I had the same problems with my RHEL3 and the only solution is to comment the line in conf/config.php that say
$conf['servers'][0]['sslmode'] = 'allow';
I also want to add something that i tried executing a php file from command line:
when trying to connect with this:
pg_connect("port=5432 sslmode='allow' user='testpgadmin' password='asdfgh' dbname='template1'");
it complains with this message: Unable to connect to PostgreSQL server: invalid connection option "sslmode"
But i could connect with this:
pg_connect("port=5432 requiressl=true user='testpgadmin' password='asdfgh' dbname='template1'");
And also with this:
pg_connect("port=5432 user='testpgadmin' password='asdfgh' dbname='template1'");
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I can't login in phpPgAdmin. I've installed phpPgAdmin in all the RHEL and FC distros, but in RHEL3 I can't make it work properly. I can't see any information in the RHEL3 logs, I only see a 'Login failed' error in /var/log/messages which is useless. I don't know how can I config Postgre to see useful information about the login error in phpPgAdmin.
Thanks.
Hello,
How did you setup your conf/config.inc.php in ppa ? what about your pg_hba.conf ? server entries in conf/config.inc.php should be setted according to your pg_hba.conf...
Moreover, PostgreSQL should have its own log file (probably in /var/log/postgresql/ ?) instead of /var/log/messages.
++
I know that exists a log file in /var/log/pgsql, but it's empty, so I don't know what to do to make postgre to log in it.
I've review config files and they're correct. But I also have a doubt. I have 2 config files <ppa>/config.inc.php y <ppa>/conf/config.inc.php, which is the one that ppa uses??
PPA uses conf/config.inc.php.
could you show us your pg_hba.conf and conf/config.inc.php please ?
could you log in your db using with psql ?
ppa is in the same server that pgsql. I can log in Postgre using psql without any problems.
pg_hba.conf:
local all postgres md5
local template1 all md5
local sameuser all md5
host sameuser all 0.0.0.0 0.0.0.0 md5
conf/config.inc.php:
$conf['servers'][0]['desc'] = 'PostgreSQL';
$conf['servers'][0]['host'] = '';
$conf['servers'][0]['port'] = 5432;
$conf['servers'][0]['sslmode'] = 'allow';
$conf['servers'][0]['defaultdb'] = 'template1';
$conf['servers'][0]['pg_dump_path'] = '/usr/bin/pg_dump';
$conf['servers'][0]['pg_dumpall_path'] = '/usr/bin/pg_dumpall';
$conf['servers'][0]['slony_support'] = false;
$conf['servers'][0]['slony_sql'] = '/usr/share/pgsql';
$conf['default_lang'] = 'auto';
$conf['autocomplete'] = 'default on';
$conf['extra_login_security'] = true;
$conf['owned_only'] = false;
$conf['show_comments'] = true;
$conf['show_advanced'] = false;
$conf['show_system'] = false;
$conf['show_reports'] = true;
$conf['owned_reports_only'] = false;
$conf['min_password_length'] = 1;
$conf['left_width'] = 200;
$conf['theme'] = 'default';
$conf['show_oids'] = false;
$conf['max_rows'] = 30;
$conf['max_chars'] = 50;
$conf['use_xhtml'] = false;
$conf['help_base'] = 'http://www.postgresql.org/docs/%s/interactive/';
$conf['version'] = 17;
So,
According to your pg_hba.conf file, you can login to your dbms using socket with all roles but only to access the template1 database (local template1 all md5).
Moreover, you can log as postgres using socket to access every database (local all postgres md5 ).
BUT, in ppa conf file, you have setted $conf['extra_login_security'] = true which deny postgres, admin, root (afair) roles by security.
I guess it could be your problem and ppa should inform you about that. Try to set this conf value to false.
I've tried to set to false the extra_login_security and it doesn't work. The problem is that I'm not trying to log in using the postgres (root, admin, ...) user. I'm trying to log in using a normal account.
you need to either get your postgresql logging working correctly by way of postgresql.conf (which i strongly recommend regardless), or hack the line with @pg_connect in libraries/adodb/drivers/adodb-postgres64.inc.php to remove the @. In either case you should recieve a FATAL error message which should tell us much more about your problem. BTW, could you also let us know if you can login via psql and the same credentials?
I've hack the line with @pg_connect and the errors shown are these:
Warning: pg_connect(): Unable to connect to PostgreSQL server: invalid connection option "sslmode" in /usr/share/phpPgAdmin-4.1.2/libraries/adodb/drivers/adodb-postgres64.inc.php on line 655
Warning: Cannot modify header information - headers already sent by (output started at /usr/share/phpPgAdmin-4.1.2/libraries/adodb/drivers/adodb-postgres64.inc.php:655) in /usr/share/phpPgAdmin-4.1.2/classes/Misc.php on line 372
Any idea??
GREAT!!! FINALLY, it works!!! The problem was sslmode option that was set to 'allow'. I have set this option to 'disable' and it have worked.
So thanks a lot for your help, Robert and Guillaume!!!
Now, I only have a doubt. Why does the sslmode='allow' option work correctly in RHEL4 and RHEL5, but it doesn't in RHEL3??? Can I connect PG using SSL or not??
I presume RHEL3 contains the older postgresql libraries that don't support the various host options, and your postgres support inside php is compiled to those libraries. We've seen this happen to some other folks, though haven't been able to put together a solid fix that works for everyone.
I confirm this fact! I had the same problems with my RHEL3 and the only solution is to comment the line in conf/config.php that say
$conf['servers'][0]['sslmode'] = 'allow';
I also want to add something that i tried executing a php file from command line:
when trying to connect with this:
pg_connect("port=5432 sslmode='allow' user='testpgadmin' password='asdfgh' dbname='template1'");
it complains with this message: Unable to connect to PostgreSQL server: invalid connection option "sslmode"
But i could connect with this:
pg_connect("port=5432 requiressl=true user='testpgadmin' password='asdfgh' dbname='template1'");
And also with this:
pg_connect("port=5432 user='testpgadmin' password='asdfgh' dbname='template1'");
Hi,
We fixed that in the current CVS.
Please, checkout the CVS version and report if you still have connection issues.