osx - Installing PDO-drivers for PostgreSQL on Mac (using Zend for eclipse) -
how can pdo work on mac (os x 10.5)? i'm using built in php , php in zend/eclipse. can't seem find useful drivers @ all.
i had install pdo_pgsql driver on leopard, , ran across multitude of problems. in search answers, stumbled across question. have installed, , so, though question quite old, hope i've found can others (like myself) undoubtedly run similar problems.
the first thing you'll need install pear, if haven't done already, since doesn't come installed on leopard default.
once that, use pecl installer download pdo_pgsql package:
$ pecl download pdo_pgsql $ tar xzf pdo_pgsql-1.0.2.tgz
(note: may have run pecl
superuser, i.e. sudo pecl
.)
after that, since pecl installer can't install extension directly, you'll need build , install yourself:
$ cd pdo_pgsql-1.0.2 $ phpize $ ./configure --with-pdo-pgsql=/path/to/your/postgresql/installation $ make && sudo make install
if goes well, should have file called "pdo_pgsql.so
" sitting in directory should "/usr/lib/php/extensions/no-debug-non-zts-20060613/
" (the pecl installation should have outputted directory installed extension to).
to finalize installation, you'll need edit php.ini
file. find section labeled "dynamic extensions", , underneath list of (probably commented out) extensions, add line:
extension=pdo_pgsql.so
now, assuming first time you've installed php extensions, there 2 additional steps need take in order working. first, in php.ini
, find extension_dir
directive (under "paths , directories"), , change directory pdo_pgsql.so
file installed in. example, extension_dir
directive looks like:
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613"
the second step, if you're on 64-bit intel mac, involves making apache run in 32-bit mode. (if there's better strategy, i'd know, now, best find.) in order this, edit property list file located @ /system/library/launchdaemons/org.apache.httpd.plist
. find these 2 lines:
<key>programarguments</key> <array>
under them, add these 3 lines:
<string>arch</string> <string>-arch</string> <string>i386</string>
now, restart apache, , pdo_pgsql , running.
Comments
Post a Comment