Connect PostgreSQL with XAMPP

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Connect PostgreSQL with XAMPP

Postby buggyec » 09. July 2009 16:38

Hello, I have a little problem connecting postgresql with XAMPP because I edit php.ini and uncomment extension=php_pgsql.dll and restart apache in the XAMPP control panel but it doesn't work. I can't connect to postgresql

Help me please :cry:
User avatar
buggyec
 
Posts: 10
Joined: 09. July 2009 15:38

Re: Connect PostgreSQL with XAMPP

Postby glitzi85 » 09. July 2009 22:14

buggyec wrote:Hello, I have a little problem connecting postgresql with XAMPP because I edit php.ini and uncomment extension=php_pgsql.dll and restart apache in the XAMPP control panel but it doesn't work. I can't connect to postgresql

Can't connect is not a error message. What's the output of your script? Are you able to connect to PostgreSQL with the Admin tools from the PostgreSQL Installation?

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Connect PostgreSQL with XAMPP

Postby buggyec » 10. July 2009 15:48

hello

I guess the connection to postgres is able because in the phpinfo() I saw the information and the part of pgsql is rigth.

In the login.php the message is error in login but it is not for user and password this error is the application can't connect to postgres.

I tested my application using appserv :lol: and it works good with postgres but with Xampp it doesn't work. :(

Thanks for reply :shock:
User avatar
buggyec
 
Posts: 10
Joined: 09. July 2009 15:38

Re: Connect PostgreSQL with XAMPP

Postby glitzi85 » 10. July 2009 16:46

And what application is throwing this error message? I had a similar problem with a fresh phpPgAdmin-Installation, there I forgot to change some settings.
If the script is written by yourself, then you need to use the pg_last_error()-Function to see what the problem is.

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Connect PostgreSQL with XAMPP

Postby buggyec » 14. July 2009 01:16

My error is login error but it is not for the user and password, I can't connect with postgres
User avatar
buggyec
 
Posts: 10
Joined: 09. July 2009 15:38

Re: Connect PostgreSQL with XAMPP

Postby glitzi85 » 14. July 2009 13:33

buggyec wrote:My error is login error but it is not for the user and password, I can't connect with postgres

Did you read my post? What application is throwing this error? Is it a script you've downloaded from the internet or did you program it by yourself?

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Connect PostgreSQL with XAMPP

Postby buggyec » 15. July 2009 17:42

I did my script, using appserv it works but with xampp I can't connect to postgres
User avatar
buggyec
 
Posts: 10
Joined: 09. July 2009 15:38

Re: Connect PostgreSQL with XAMPP

Postby buggyec » 15. July 2009 18:38

I restart php in XAMPP and I have this error and I think it is the reason that XAMPP can't connect to Postgres

Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/php-5.2.9/extensions/no-debug-non-zts-20060613/php_pgsql.dll

Please help
User avatar
buggyec
 
Posts: 10
Joined: 09. July 2009 15:38

Re: Connect PostgreSQL with XAMPP

Postby glitzi85 » 15. July 2009 20:06

OK, i've googled now what AppServ is, i thought it is an application...

Did you install PostgreSQL? It is NOT included in XAMPP!

Also it is not possible to restart PHP, as PHP is just a module of Apache. And that is the last time i ask this question: What script are you using?

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Connect PostgreSQL with XAMPP

Postby buggyec » 02. August 2009 17:34

my script


<?php
$conexion = pg_connect("host=localhost port=5432 password=*** user=postgres dbname=***") or die('Can't connect!!!: ' . pg_last_error());
?>


The library pgsql.dll works in windows. I think my script is right because I use this script in AppServ
User avatar
buggyec
 
Posts: 10
Joined: 09. July 2009 15:38

Re: Connect PostgreSQL with XAMPP

Postby Wiedmann » 02. August 2009 19:27

and uncomment extension=php_pgsql.dll
...
Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/php-5.2.9/extensions/no-debug-non-zts-20060613/php_pgsql.dll

*.dll" are Windows shared libraries. On *nix/OS X they are always named "*.so".

Also the shared pgsql extension have the name "pqsql.so".Thus you have to use:
Code: Select all
extension=pgsql.so
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 9 guests