Arquivo da tag: PostgreSQL PDO

Enable PostgreSQL PDO support on OS X

cd ~/Downloads
tar -jxvf php-5.5.20.tar.bz2
sudo mkdir -p /usr/include
sudo mv php-5.5.20 /usr/include/php
cd /usr/include/php
./configure --without-iconv
cd ext/pdo_pgsql
brew install autoconf
phpize
./configure --with-pdo-pgsql=/Applications/Postgres.app/Contents/Versions/9.4/
make
sudo cp pdo_pgsql.so /usr/lib/php/extensions/no-debug-non-zts-20121212

https://www.alistairphillips.com/apple/osx/php-pdo-pgsql/

Install PHP PGSQL extensions on Mac OS X Yosemite (change PHP_VER with your PHP version)

PHP_VER="5.5.14"
 
# Check if extension exists first
php -m | grep pgsql
 
# Update brew and install requirements
brew update
brew install autoconf
 
# Download PHP source and extract
mkdir -p ~/src; cd ~/src
wget -c http://br1.php.net/distributions/php-$PHP_VER.tar.bz2
tar -xjf php-$PHP_VER.tar.bz2
 
# Go to extension dir and phpize
cd php-$PHP_VER/ext/pdo_pgsql/
phpize
 
# Configure for Postgress.app
# Use just "./configure" for brew version
./configure --with-pdo-pgsql="/Library/PostgreSQL/9.3/"
make
sudo make install
 
# Add extension to php.ini
sudo echo "extension=pdo_pgsql.so" >> /private/etc/php.ini
 
# Go to extension dir and phpize
cd php-$PHP_VER/ext/pgsql/
phpize
 
# Configure for Postgress.app
# Use just "./configure" for brew version
./configure --with-pgsql="/Library/PostgreSQL/9.3/"
make
sudo make install
 
# Add extension to php.ini
sudo echo "extension=pgsql.so" >> /private/etc/php.ini
 
# Check if extension exists, again
php -m | grep pgsql