B
B
BonBon Slick2019-07-28 06:07:10
PHP
BonBon Slick, 2019-07-28 06:07:10

PhpPgAdmin Failed Login?

access log

ip1 - - [27/Jul/2019:22:50:02 -0400] "POST /redirect.php HTTP/2.0" 200 1217 "https://test.tv/r
edirect.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.3
6"

1ip1 - - [27/Jul/2019:22:50:02 -0400] "GET /browser.php HTTP/2.0" 200 1369 "https://test.tv/bro
wser.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36" 

1ip61 - - [27/Jul/2019:22:50:02 -0400] "GET /servers.php?action=tree HTTP/2.0" 200 439 "https://test.tv/browser.php" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safa
ri/537.36"

error log
php PHP message: PHP Parse error: syntax error, unexpec ted 'as' in

file
L106: foreach ($error_regexps as $regexp => $code) {
L107:    if (preg_match($regexp, $errormsg)) {
L108:       return $code;
L109:    }
L110: }

Edits made to this code https://github.com/halojoy/phppgadmin-for-PHP7
Edited because https://sourceforge.net/p/phppgadmin/bugs/468/
Visible UI form error LOGIN FAILED . Tried different postgres and other users, passwords are 100% correct.
Why is it giving errors?
  1. LOGIN FAILED
  2. php PHP message: PHP Parse error: syntax error, unexpec ted 'as' in here

It is not clear to me why it gives an error to the correct code in the logs, at the same time it displays an error on the UI. There is nothing else in the logs. PHP Parse error when submitting login form.
Here are additional configs
/etc/postgresql/9.6/main/postgresql.conf
listen_addresses = '*'; 
port = 5432                             # (change requires restart)
max_connections = 100                   # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
ssl = true                              # (change requires restart)
...

/etc/phppgadmin/config.inc.php
$conf['servers'][0]['host'] = 'https://phppgadmin.test.tv/';
        $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['autocomplete'] = 'default on';
        $conf['extra_login_security'] = false;
        $conf['owned_only'] = true;
        $conf['show_comments'] = true;

/etc/postgresql/9.6/main/pg_hba.conf
# Database administrative login by Unix domain socket
local   all             postgres                                password
#local   all             postgres                                md5 
#host   all             all             ...serverip...         md5
#host   all             all             all                     peer 

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer

# IPv4 local connections:
host    all             all             127.0.0.1/32            password
#host    all             all             127.0.0.1/32            md5  
#host    all             all             127.0.0.1/32            peer

# IPv6 local connections:
host    all             all             ::1/128                 password
#host    all             all             ::1/128                 md5 

# Allow replication connections from localhost, by a user with the   
# replication privilege.
#local   replication     postgres                                peer 
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

nginx
server {  
listen  443 ssl http2;
listen [::]:443 ssl http2

 server_name     subdomain.test.tv;

 root            /usr/share/phppgadmin;
index index.php index.html index.html 

 include /etc/letsencrypt/options-ssl-nginx.conf;
location ~ /\.ht {
deny all;
}

location / {
 try_files $uri $uri/ =404;   
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question