简体   繁体   中英

Postgresql, phpPgAdmin in xammp

Hi I have this error while I'm trying to launch phpPgAdmin:

Your PHP installation does not support PostgreSQL. You need to recompile PHP using the --with-pgsql configure option.

I'm using XAMPP ver 1.7.7, Postgresql 9.2.4 64 bit, and phpPgAdmin 5.1.

I already did the following:

  1. Open config.inc.php found in C:\\xampp\\phpPgAdmin\\conf\\ and set extra_login_security to false
$conf['extra_login_security'] = false;
  1. Find php.ini file in C:\\xampp\\php\\ , then look for the line ; extension = php_pgsql.dll ; extension = php_pgsql.dll . Remove tag ; , so that the result was extension = php_pgsql.dll .

(although I found php.ini- production and development so I uncomment them both)

  1. Open C:\\xampp\\apache\\conf\\extra\\httpd-xampp.conf and in section <IfModule mime_module> add
Alias /phppgadmin "c:/xampp/phpPgAdmin/"
<Directory "c:/xampp/phpPgAdmin">
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all
</Directory>
  1. LoadFile “C:/xammp/php/libpq.dll”

but I still get this error. Can someone help me?

I am writing the answer from the beginning, not everything what you tried was wrong.

xampp is up and running.

Download phpPgAdmin and copy it into c:\\xampp\\phpPgAdmin

Modify the config file

C:\\xampp\\apache\\conf\\extra\\httpd-xampp.conf

Add like phpMyAdmin part the phpPgAdmin part:

Alias /phppgadmin "C:/xampp/phpPgAdmin/"
<Directory "C:/xampp/phpPgAdmin">
    AllowOverride AuthConfig
    Require all granted
</Directory>

Restart apache and enter in browser

http://127.0.0.1/phppgadmin/

Now you would get the message: install php with –-pqsql option

Postgres installation and the configuration:

Install postgresql 32bit even if you have 64bit windows (this is not a joke)

Postgres is now up and running

Modify again the config file

C:\\xampp\\apache\\conf\\extra\\httpd-xampp.conf

Add the following line (in my case PostgreSQL is installed in C:/xampp/PostgreSQL):

LoadFile "C:/xampp/PostgreSQL/bin/libpq.dll"

before the following existing lines

LoadFile "C:/xampp/php/php5ts.dll"
LoadModule php5_module "C:/xampp/php/php5apache2_4.dll"

Modify the config file

C:\\xampp\\php\\php.ini

Uncomment the following line by removing ';'

;extension=php_pgsql.dll

Restart apache and enter again in your browser

http://127.0.0.1/phppgadmin/

It should work, it works for me

Not need to install postgresql 32 bit version just enable php_pgsql.dll extension in your php.ini file and do restart apache service

event though you get error like "cdbconnection failed to open the db connection could not find driver postgresql" then

please add below line in php.ini file and restart apache

extension=php_pdo_pgsql

Now it should work perfact

Just make sure in your C:\\xampp\\php\\php.ini to uncomment the following line by removing ';'

extension=php_pdo_pgsql
extension=pgsql

or if you don't have those lines then add them.

Then restart Apache and it should work just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM