質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
phpPgAdmin

phpPgAdminは、PHPで作成された複数のPostgreSQLデータベースをブラウザから簡単に管理・操作できるツール。テーブルの作成や参照を始め、データのバックアップやリストアといった操作が可能になります。

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

Q&A

解決済

1回答

1619閲覧

phpPgAdminにてログイン状態継続しない

koala2

総合スコア24

phpPgAdmin

phpPgAdminは、PHPで作成された複数のPostgreSQLデータベースをブラウザから簡単に管理・操作できるツール。テーブルの作成や参照を始め、データのバックアップやリストアといった操作が可能になります。

PostgreSQL

PostgreSQLはオープンソースのオブジェクトリレーショナルデータベース管理システムです。 Oracle Databaseで使われるPL/SQLを参考に実装されたビルトイン言語で、Windows、 Mac、Linux、UNIX、MSなどいくつものプラットフォームに対応しています。

0グッド

0クリップ

投稿2020/02/17 02:32

編集2020/02/17 03:02

現在、phpPgAdminとpostgreSQLの連携を試みています。
postgreにてログインユーザーを作成してphpPgAdminでログインしてみたところ
一時的にはログイン可能なものの画面を進むために毎回ログイン認証が出てきてしまいます。

イメージ説明

画面上部のバーにはログイン中と書いてあるため、ログインには成功していますが、PostgresSQLが×印がついているため、何かがうまくいっていないようです。

・phpPgAdminのconf設定

html

1<?php 2 3 /** 4 * Central phpPgAdmin configuration. As a user you may modify the 5 * settings here for your particular configuration. 6 * 7 * $Id: config.inc.php-dist,v 1.55 2008/02/18 21:10:31 xzilla Exp $ 8 */ 9 10 // An example server. Create as many of these as you wish, 11 // indexed from zero upwards. 12 13 // Display name for the server on the login screen 14 $conf['servers'][0]['desc'] = 'PostgreSQL'; 15 16 // Hostname or IP address for server. Use '' for UNIX domain socket. 17 // use 'localhost' for TCP/IP connection on this computer 18 $conf['servers'][0]['host'] = 'localhost'; 19 20 // Database port on server (5432 is the PostgreSQL default) 21 $conf['servers'][0]['port'] = 5432; 22 23 // Database SSL mode 24 // Possible options: disable, allow, prefer, require 25 // To require SSL on older servers use option: legacy 26 // To ignore the SSL mode, use option: unspecified 27 $conf['servers'][0]['sslmode'] = 'allow'; 28 29 // Change the default database only if you cannot connect to template1. 30 // For a PostgreSQL 8.1+ server, you can set this to 'postgres'. 31 $conf['servers'][0]['defaultdb'] = 'template1'; 32 33 // Specify the path to the database dump utilities for this server. 34 // You can set these to '' if no dumper is available. 35 $conf['servers'][0]['pg_dump_path'] = '/usr/bin/pg_dump'; 36 $conf['servers'][0]['pg_dumpall_path'] = '/usr/bin/pg_dumpall'; 37 38 // Example for a second server (PostgreSQL for Windows) 39 //$conf['servers'][1]['desc'] = 'Test Server'; 40 //$conf['servers'][1]['host'] = '127.0.0.1'; 41 //$conf['servers'][1]['port'] = 5432; 42 //$conf['servers'][1]['sslmode'] = 'allow'; 43 //$conf['servers'][1]['defaultdb'] = 'template1'; 44 //$conf['servers'][1]['pg_dump_path'] = 'C:\Program Files\PostgreSQL\8.0\bin\pg_dump.exe'; 45 //$conf['servers'][1]['pg_dumpall_path'] = 'C:\Program Files\PostgreSQL\8.0\bin\pg_dumpall.exe'; 46 47 48 /* Groups definition */ 49 /* Groups allow administrators to logicaly group servers together under 50 * group nodes in the left browser tree 51 * 52 * The group '0' description 53 */ 54 //$conf['srv_groups'][0]['desc'] = 'group one'; 55 56 /* Add here servers indexes belonging to the group '0' seperated by comma */ 57 //$conf['srv_groups'][0]['servers'] = '0,1,2'; 58 59 /* A server can belong to multi groups. Here server 1 is referenced in both 60 * 'group one' and 'group two'*/ 61 //$conf['srv_groups'][1]['desc'] = 'group two'; 62 //$conf['srv_groups'][1]['servers'] = '3,1'; 63 64 /* A group can be nested in one or more existing groups using the 'parents' 65 * parameter. Here the group 'group three' contains only one server and will 66 * appear as a subgroup in both 'group one' and 'group two': 67 */ 68 //$conf['srv_groups'][2]['desc'] = 'group three'; 69 //$conf['srv_groups'][2]['servers'] = '4'; 70 //$conf['srv_groups'][2]['parents'] = '0,1'; 71 72 /* Warning: Only groups with no parents appears at the root of the tree. */ 73 74 /* You can apply specific theme depending on servers, users and databases 75 * The priority order is : 76 * * the theme defined for a server 77 * * the theme defined for a database apply over the server one 78 * * the theme defined for a user apply over the database one 79 */ 80 /* Example for servers */ 81 //$conf['servers'][0]['theme']['default'] = 'default'; 82 /* Example for users */ 83 //$conf['servers'][0]['theme']['user']['specific_user'] = 'default'; 84 /* Example for databases */ 85 //$conf['servers'][0]['theme']['db']['specific_db'] = 'default'; 86 87 // Default language. E.g.: 'english', 'polish', etc. See lang/ directory 88 // for all possibilities. If you specify 'auto' (the default) it will use 89 // your browser preference. 90 $conf['default_lang'] = 'auto'; 91 92 // AutoComplete uses AJAX interaction to list foreign key values 93 // on insert fields. It currently only works on single column 94 // foreign keys. You can choose one of the following values: 95 // 'default on' enables AutoComplete and turns it on by default. 96 // 'default off' enables AutoComplete but turns it off by default. 97 // 'disable' disables AutoComplete. 98 $conf['autocomplete'] = 'default on'; 99 100 // If extra login security is true, then logins via phpPgAdmin with no 101 // password or certain usernames (pgsql, postgres, root, administrator) 102 // will be denied. Only set this false once you have read the FAQ and 103 // understand how to change PostgreSQL's pg_hba.conf to enable 104 // passworded local connections. 105 $conf['extra_login_security'] = false; 106 107 // Only show owned databases? 108 // Note: This will simply hide other databases in the list - this does 109 // not in any way prevent your users from seeing other database by 110 // other means. (e.g. Run 'SELECT * FROM pg_database' in the SQL area.) 111 $conf['owned_only'] = false; 112 113 // Display comments on objects? Comments are a good way of documenting 114 // a database, but they do take up space in the interface. 115 $conf['show_comments'] = true; 116 117 // Display "advanced" objects? Setting this to true will show 118 // aggregates, types, operators, operator classes, conversions, 119 // languages and casts in phpPgAdmin. These objects are rarely 120 // administered and can clutter the interface. 121 $conf['show_advanced'] = false; 122 123 // Display "system" objects? 124 $conf['show_system'] = false; 125 126 // Minimum length users can set their password to. 127 $conf['min_password_length'] = 1; 128 129 // Width of the left frame in pixels (object browser) 130 $conf['left_width'] = 200; 131 132 // Which look & feel theme to use 133 $conf['theme'] = 'default'; 134 135 // Show OIDs when browsing tables? 136 $conf['show_oids'] = false; 137 138 // Max rows to show on a page when browsing record sets 139 $conf['max_rows'] = 30; 140 141 // Max chars of each field to display by default in browse mode 142 $conf['max_chars'] = 50; 143 144 // Send XHTML strict headers? 145 $conf['use_xhtml_strict'] = false; 146 147 // Base URL for PostgreSQL documentation. 148 // '%s', if present, will be replaced with the PostgreSQL version 149 // (e.g. 8.4 ) 150 $conf['help_base'] = 'http://www.postgresql.org/docs/%s/interactive/'; 151 152 // Configuration for ajax scripts 153 // Time in seconds. If set to 0, refreshing data using ajax will be disabled (locks and activity pages) 154 $conf['ajax_refresh'] = 3; 155 156 /** Plugins management 157 * Add plugin names to the following array to activate them 158 * Example: 159 * $conf['plugins'] = array( 160 * 'Example', 161 * 'Slony' 162 * ); 163 */ 164 $conf['plugins'] = array(); 165 166 /***************************************** 167 * Don't modify anything below this line * 168 *****************************************/ 169 170 $conf['version'] = 19; 171 172?> 173

・ログインアカウントの権限(初期のpostgresユーザーと同じ権限に設定しました)
Superuser,Create role, Create DB, Replication, Bypass RLS

・webサーバー
nginxを使用しており、バーチャルホストにてphpPgAdminの運用を行っています。

・ソフトウェアのバージョン
phpPgAdmin:5.6
php:7.0.33
postgreSQL:9.5.20
nginx:1.17.8

お力添えをお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2020/02/17 03:00 編集

webサーバーはapache httpdなのか、nginxなのか、それのバージョンはどうか、サーバーはバーチャルホスト有効かどうか、なども添えてほしいです。webサーバーにipアドレスでアクセスしているのか、サーバー業者のドメインでアクセスしているのか、独自ドメインを設定してアクセスしているのか。ドメインとホスト名があっているか。
退会済みユーザー

退会済みユーザー

2020/02/17 02:46

さいしょ、PostgreSQLに☓がついていますが、ログイン成功すればなくなりますよ。
koala2

2020/02/17 03:05

ご回答ありがとうございます。 webサーバーはnginx(1.17.8)を使用しております。 バーチャルホストは有効です。 webサーバーには既に取得済みのドメインがあり、それを用いています。 また、上記だけではわかりづらいかもしれませんがログインした後の画面が上記の画面となります。 何度ログインしてもPostgreSQLに×がついてしまいます。
guest

回答1

0

自己解決

m6u様の回答よりNginx側の設定かと思い調べたところ下記のサイトが見つかりました。

https://umebius.com/dev/nginx-php-fpm%E3%81%A7%E3%82%BB%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E5%A4%89%E6%95%B0%E3%81%8C%E5%8F%96%E5%BE%97%E3%81%A7%E3%81%8D%E3%81%AA%E3%81%84%E5%A0%B4%E5%90%88/

nginxが/var/lib/php/sessionにファイルを書き込む権限が許可されていなことが原因でした

シェルに以下のコマンドを打つことで解消されました
sudo chgrp nginx /var/lib/php/session

投稿2020/02/17 03:25

koala2

総合スコア24

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問