Skip to content

Instantly share code, notes, and snippets.

@FilipLukac
Last active November 10, 2015 20:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FilipLukac/b460b233857a65e1342a to your computer and use it in GitHub Desktop.
Save FilipLukac/b460b233857a65e1342a to your computer and use it in GitHub Desktop.
Install pgsql + pdo_pgsql for Mac OS X El Capitan
PHP_VER="5.6.1"
PHP_INI="/usr/local/php5/lib/php.ini"
# 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 ~/php-src; cd ~/php-src
wget -c http://br1.php.net/distributions/php-$PHP_VER.tar.bz2
tar -xjf php-$PHP_VER.tar.bz2
# Install pdo
cd php-$PHP_VER/ext/pdo_pgsql/
phpize
./configure --with-pdo-pgsql="/Applications/Postgres.app/Contents/Versions/9.4"
make
sudo make install
sudo echo "extension=pdo_pgsql.so" >> $PHP_INI
# Install pgsql
cd ../pgsql/
phpize
./configure --with-pgsql="/Applications/Postgres.app/Contents/Versions/9.4"
make
sudo make install
sudo echo "extension=pgsql.so" >> $PHP_INI
# Check if extension exists, again
php -m | grep pgsql
@chandrewz
Copy link

On the make on line 20, I get fatal error: 'pdo/php_pdo_error.h' file not found #include "pdo/php_pdo_error.h"

Did you get the same thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment