pgsql extension "incomplete"?

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

pgsql extension "incomplete"?

Postby davinci » 18. February 2008 13:41

Hello people,
Thanks for the work on Xampp, I use it with pleasure.

I recently installed postgresql on a iMac Intel OS X 10.4.11. Postgresql works. Then I enabled the pgsql extension in php.ini and phpinfo() returns positive on the extenion, e.g., it's loaded.
Problems start when, in my case, developing in Symfony: I continuously get the error that one function can't be found, pg_escape_string()...
When using in the terminal

Code: Select all
php --rf pg_escape_string


it returns

Code: Select all
Exception: Function pg_escape_string() does not exist


and running

Code: Select all
php --re pgsql


returns a list of all functions which belong to the extension, which lack pg_escape_string... Is the OSX version of Xampp with pgsql built correct? And second: is it possible to make my own build of PHP5 with the Xampp_dev package?

Cheers,
Vinci
davinci
 
Posts: 11
Joined: 18. February 2008 13:32

Postby jmdirc » 18. February 2008 15:47

User avatar
jmdirc
 
Posts: 154
Joined: 10. February 2008 22:44

Postby davinci » 18. February 2008 17:05

Yes I know what the function means, that's not the problem.
The thing is: the Xampp version I also installed on a WinXP box returns after
Code: Select all
php --re pgsql

in the cmd-prompt of WinXP a similar list as on the mac, but it contains the pg_escape_string() function...
So: how is it possible that this function is missing in the mac-xampp-php-extension pgsql and does exist in the winxp-xampp-php-extension?
davinci
 
Posts: 11
Joined: 18. February 2008 13:32

Postby Wiedmann » 18. February 2008 17:09

So: how is it possible that this function is missing in the mac-xampp-php-extension pgsql and does exist in the winxp-xampp-php-extension?

While reading the PHP manual, I think the PostgreSQL (library) version is less then 7.2.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby davinci » 18. February 2008 19:22

Do you mean the PostgreSQL library packed with Xampp is less then 7.2?
Is it possible to upgrade it to a newer version easily? Would be great...!
davinci
 
Posts: 11
Joined: 18. February 2008 13:32

Postby jmdirc » 18. February 2008 20:32

version 8.2.5

the only notes I found on it,

xamppfiles/doc/postgresql/html/postgres-user.html


There is info about upgrading to the next version in the user guide also.
------

updates:

http://www.postgresql.org/ftp/source/v8.2.6/

don't know if you can up to 8.3.0 but here is the link

http://www.postgresql.org/ftp/source/v8.3.0/
User avatar
jmdirc
 
Posts: 154
Joined: 10. February 2008 22:44

Postby davinci » 19. February 2008 09:46

To jmdirc: strange:
Code: Select all
postgres --version

in the terminal returns
Code: Select all
postgres (PostgreSQL) 8.2.3


This would mean that I have a compliant version because php.net says on pg_escape_string():
Code: Select all
Note: This function requires PostgreSQL 7.2 or later.


Which library could then be of the wrong version?
Btw, I got my PostgreSQL from the entropy.ch website.

Vinci
davinci
 
Posts: 11
Joined: 18. February 2008 13:32

Postby Wiedmann » 19. February 2008 10:08

Which library could then be of the wrong version?

The PostgreSQL libraray which was used to build/compile the extension. (Can't you see this version number in phpinfo?)
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby davinci » 19. February 2008 11:09

This is from phpinfo():
Code: Select all
PostgreSQL(libpq) Version    8.2.5


(Thanks for your responses!)
davinci
 
Posts: 11
Joined: 18. February 2008 13:32

Postby davinci » 20. February 2008 11:18

Still no solution over here... Anyone...?
Is someone already busy compiling Xampp with a newer pgsql-library? Would be great!

vinci
davinci
 
Posts: 11
Joined: 18. February 2008 13:32

Postby kopanda » 25. June 2008 06:40

I've just found a solution to this. I copy the pdo_pgsql and pgsql libraries of entropy's php package and it works properly.

download the package form
http://www2.entropy.ch/download/entropy ... he2.tar.gz

unpack it and show package contents of the pkg file.

look for /Contents/Packages/entropy-php-extension-postgresql.pkg

show package contents of the file

look for /Contents/Archive.pax.gz

unzip the file

you will find the pdo_pgsql and pgsql libraries binary under
lib/php/extensions/no-debug-non-zts-20060613/

copy the files to /Applications/xampp/xamppfiles/lib/php/php5/extensions/no-debug-non-zts-20060613/

edit your php.ini file and add the following 2 lines

extension=pgsql
extension=pdo_pgsql

save the php.ini and restart xampp

hope this help.
kopanda
 
Posts: 1
Joined: 25. June 2008 05:53

Postby davinci » 03. July 2008 13:20

Well it seems a great solution but it didn't work...
Fact is that the Entrpoy-package is compiled with PHP installed on a different path, so the pgsql extension is searching for this file:
Code: Select all
/usr/local/php5/lib/libpq.4.dylib
And with XAMPP installed it is in a different place... So maybe I'd better compile XAMPP myself.
davinci
 
Posts: 11
Joined: 18. February 2008 13:32

Postby pkiula » 15. July 2008 01:37

Hi. Did you manage to solve this?

I have done everything possible too. I also have installed postgresql and dumped the extensions from the entropy package into the right folder. But PHP does not recognize postgresql. Also, how should I easily start postgresql?

Thanks
pkiula
 
Posts: 4
Joined: 30. June 2008 03:35

Re: pgsql extension "incomplete"?

Postby mavetx » 05. March 2009 00:11

It seems the solution is incomplete, too. Anyway, let's get it finished.

A file is needed for Entropy build and it has to be at /usr/local/php5/lib/libpq.4.dylib. "Accidentatly", you can find this file at the Entropy package. If you check the Archive.pax.gz, you can find it at lib/libpq.4.dylib. Just copy it and place it at your /usr/local/php5/lib, then you are ready to run the PostgreSQL connection with pg_escape_string().
mavetx
 
Posts: 1
Joined: 05. March 2009 00:06


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 3 guests