A few days ago I updated
the OS X to the latest in my MacBook Air, I had running there Apache + Php +
PostgreSQL. My surprise was that the PHP Module for PostgreSQL has
been deleted in this version, so consequently start my odyssey to get
back to normal the whole system. Following references from dozens of
Websites, I summarized all the key points in order not to lose more
time anymore:
First step, download the
PHP with the version included in OS X 10.9.4
sudo
curl -O http://us.php.net/distributions/php-5.4.24.tar.gz
sudo
tar -xzvf php-5.4.24.tar.gz
sudo
mkdir -p /usr/include
sudo
mv php-5.4.24 /usr/include/php
cd
/usr/include/php
./configure
--without-iconv
phpize
You
will get the following message:
Configuring
for:
PHP
Api Version: 20100412
Zend
Module Api No: 20100525
Zend
Extension Api No: 220100525
Cannot
find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF
environment variable. Then, rerun this script.
Then
execute:
brew
install autoconf
Warning:
No developer tools installed.
You
should install the Command Line Tools.
Run
`xcode-select --install` to install them.
Warning:
autoconf-2.69 already installed
At
this point the most common thing is not to have autoconf installed in
your computer. (Additionally the Xcode extension is needed, you can
get this from iTunes)
xcode-select
--install
sudo
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz
sudo
tar xzf autoconf-latest.tar.gz
cd
autoconf-2.69/
./configure
–prefix=/usr/local
make
sudo make install
At this point, we have
completed the installation of autoconf.
brew
install autoconf
cd /ext/pgsql
Once there:
sudo
./configure –with-pgsql=/Library/PostgreSQL/9.3
Where
you set the folder where the local instance of PostgreSQL is
currently installed in your system.
make
sudo
make install
At
this point you can restart your web server:
sudo
/usr/sbin/apachectl restart
and
check with phpinfo in your php script that pgsql module is enabled.
Remember
that the extension must be enabled in your php.ini file:
sudo
vi /private/etc/php.ini
Within
the file:
extension=pgsql.so
Follow us in twitter: twitter.com/it4up