By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,991 Members | 1,887 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,991 IT Pros & Developers. It's quick & easy.

Postgres from PHP in Leopard

P: n/a
I'm a web developer who does a lot of work in PHP. The back end
database we use is bases on Postgres. I am trying to set my new
MacBook Pro up as a development system.

I have managed to install Postgres from http://sourceforge.net/projects/pgsqlformac/
and can access the database on my mac with tools such as pgAdmin. I
have also enabled the bundled Apache and PHP extensions.

However, the problem is that I can't get PHP to talk to Postgres.
Running phpinfo () on the built in PHP shows that database support
extends as MySql, Mysqli and SQLite extensions, and SQLite drivers for
PDO. What I really need is a Postgres extension for maintaining older
code and a Postgres PDO driver for new code in development.

When setting up a similar dev system on Windows it was relatively
simple to set this all up. The extensions for PHP were provided
in .dll files that you just had to include in the php.ini file. This
doesn't seem to be the case with the MacOS bundled PHP.

Is it possible to download .so files (I believe that's what the MacOS
equivalent to .dll files are) for the drivers and include them from
the php.ini file like on the Windows box? Or is there something else
I'm meant to be doing?
Dec 19 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Dec 19, 11:32 am, Gordon <gordon.mc...@ntlworld.comwrote:
I'm a web developer who does a lot of work in PHP. The back end
database we use is bases on Postgres. I am trying to set my new
MacBook Pro up as a development system.

I have managed to install Postgres fromhttp://sourceforge.net/projects/pgsqlformac/
and can access the database on my mac with tools such as pgAdmin. I
have also enabled the bundled Apache and PHP extensions.

However, the problem is that I can't get PHP to talk to Postgres.
Running phpinfo () on the built in PHP shows that database support
extends as MySql, Mysqli and SQLite extensions, and SQLite drivers for
PDO. What I really need is a Postgres extension for maintaining older
code and a Postgres PDO driver for new code in development.

When setting up a similar dev system on Windows it was relatively
simple to set this all up. The extensions for PHP were provided
in .dll files that you just had to include in the php.ini file. This
doesn't seem to be the case with the MacOS bundled PHP.

Is it possible to download .so files (I believe that's what the MacOS
equivalent to .dll files are) for the drivers and include them from
the php.ini file like on the Windows box? Or is there something else
I'm meant to be doing?
Anyone?
Dec 20 '07 #2

P: n/a
In article
<df**********************************@w56g2000hsf. googlegroups.com>,
Gordon <go**********@ntlworld.comwrote:
Anyone?
Well, you'll probably have to recompile PHP to include postgres, no?

I compiled postgresql in Tiger, on a G4, and all the *.so files wound up
in /usr/local/pgsql; then I recompiled PHP and told it where to look
for pgsql, and voila. I'm not sure how the package you have works. I
can't find any dynamic extensions in the stock Leopard PHP setup;
/etc/php.ini points to ./ as the directory they're supposed to be in,
and I'm not even sure what that might mean.
--
W. Oates
Dec 20 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.