SoFunction
Updated on 2025-03-10

phpPgAdmin Solutions for common errors and problems

1. Installation error
Q: I have installed phpPgAdmin, but when I try to use it,
I get an error saying that the PHP I installed does not have correct compiled database support.

A: This information means that your PHP does not compile PostgreSQL support into it. The correct configuration option is '--with-pgsql' .
Please read the PHP manual carefully for more detailed information on how to compile PHP.

PostgreSQL supports dynamic extension modules that can be compiled into PHP.
Therefore, if you are using a precompiled version of PHP (RPM packages under Linux or binary files under Windows, etc.),
Maybe you only need to do one thing:

Edit the file and uncomment the following two lines:
(It is usually located in the C:\WINDOWS or C:\WINNT directory under Windows, and it is usually located in /etc/ under Linux)

        ;extension=php_pgsql.dll ;Windows
 ;extension=  ;Linux

Make it into:

        extension=php_pgsql.dll  ;Windows
 extension=  ;Linux

On Linux distributions based on Red Hat or Fedora,
The PHP extension has been automatically configured in the /etc// file.
Just install the php-pgsql package.


Q: When using phpPgAdmin on Windows, I get a warning message like this:

    "Warning: session_start() [-start]:
     open(/tmp\sess_5a401ef1e67fb7a176a95236116fe348, O_RDWR) failed"

A: You need to modify your file (usually located in the c:\windows directory) and turn the following line

    session.save_path = "/tmp"

Modified to

    session.save_path = "c:\windows\temp"

And make sure the c:\windows\temp directory does exist.
2. Login error
Q: I always get a "Login failed" and I'm sure I'm using the correct username and password!

A: Check the PostgreSQL log, it will tell you the exact reason for the login failure.
Edit the pg_hba.conf file in the "data" directory of PostgreSQL,
Make sure you have the correct permissions to access the database server.

If you install phpPgAdmin on a machine that is different from the PostgreSQL server,
Another possible reason is that PostgreSQL does not enable TCP/IP sockets at startup.
To enable it, you can edit the file, and put the following line

    #tcpip_socket = false

Modified to

    tcpip_socket = true

Then restart PostgreSQL.
[Translator's Note] Starting from version 8.0, the original virtual_host and tcpip_socket configuration directives have been replaced by listen_addresses.
See PostgreSQL for more explanations of the listen_addresses directive.

Q: Some users will get "Login disabled for security" error message

A: phpPgAdmin prohibits empty passwords or login by specific users (pgsql, postgres, root, administrator) by default.
Before changing this default behavior (set $conf['extra_login_security'] in the file to false),
Please read the part about client authentication in the PostgreSQL document carefully.
And fully understand how to modify PostgreSQL's pg_hba.conf configuration file to enable password-protecting local connections.

Q: I can log in with any password!

A: PostgreSQL runs in "Trust Mode" by default. It means that the password is not checked for local connections.
We strongly recommend that you modify the pg_hba.conf file and change the login type to 'md5'.
Note that once you change the 'local' login type to 'md5', you may need to enter your password when starting PostgreSQL.
To avoid it, you can use a .pgpass file. For details, please refer to the libpq section of the PostgreSQL document.
3. Other errors
Q: When I enter non-ASCII data into the database through the form, it is inserted in front of a hexadecimal number or in the Ӓ format.

A: You are not creating the database with the correct encoding.
This problem occurs when you attempt to enter vowel umlaut into a SQL_ASCII database.
Or when entering SJIS characters into the EUC-JP database.

Q: When I drop and rebuild a table with the same name, it failed.

A: The easiest way is to use PostgreSQL 7.3 or above.

Q: When I browse a table, the 'edit' and 'delete' links are not displayed.

A: phpPgAdmin will use the following values ​​as row unique identifiers in order

1. Primary key
2. Unique index (cannot be partial index or expression index)
3. OID column (requires continuous scans for updates unless you index on the OID column)

Additionally, any NULL value in the unique index will make that line uneditable. Similarly, because OIDs may be repeated in the same table,
phpPgAdmin will confirm whether the modified line is indeed that line after changing it, otherwise it will roll back.
4. Dump related
Q: How to enable database dumping?

A: You need to configure the file to specify the location of pg_dump and pg_dumpall.
In this way, the database export function will be displayed.

Q: I want to use pg_dump on Windows, where should I download pg_dump.exe?

A: You need to install PostgreSQL 8.0 for Windows or higher.
You can download it at /ftp/win32/.
After installation, you can set the locations of pg_dump and pg_dumpall in .

Q: Why can't I reload the dumped SQL script in the SQL window?

A: There are the following restrictions when executing SQL scripts:

* Only uploaded SQL scripts can contain COPY commands and must use PHP 4.2 or above.

* 'psql' commands, such as '\connect', will not work at all.

* Multi-line SQL statements will not work either, for example:

  CREATE TABLE example (
   a INTEGER
  );

* The database and user cannot be switched during the execution of the script.

We intend to reduce these restrictions in future releases, but we can do nothing about the restrictions on PostgreSQL itself.
Therefore, we recommend that you use the 'psql' tool to recover the complete SQL dump results.

V. Other issues

Q: When inserting a row, what does the 'Value(value)' or 'Expression(expression)' box mean?

A: Select 'Expression' to indicate that you can use functions, operators, field names, etc.
At the same time, you need to use quotes to correctly define the string value.
Selecting 'Value' means that no matter what you enter, it will be inserted into the database as is.

Q: Why does the 'Info(Information)' page of the table never display any information?

A: The 'Info' page is used to display foreign keys from other tables to this table and statistics from PostgreSQL.
The status statistics program is not enabled by default. To enable it, see the stats_* option in the file.
Set all of these options to 'true' and restart PostgreSQL.

Q: Why can't I download the result data of the query executed in the SQL window?

A: You need to select the 'Paginate results' option to allow downloads.

Q: I want to help with the development of phpPgAdmin, what should I do?

A: We are very willing to get your help! Please read the DEVELOPERS and TRANSLATORS files.