mac compile php for pdo_pgsql

install command-line

$ xcode-select --install

install postgresql

download from postgresapp.com Postgres.app

$ mv Postgres.app /Applications

$ vi .bash_profile
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin

install gnu support for compile (m4, autoconf, automaker, libtool)

http://www.gnu.org/software/m4/

$ tar -xzvf m4-1.4.17.tar.gz
$ cd m4-1.4.17
$ ./configure --prefix=/usr/local
$ make
$ sudo make install

http://www.gnu.org/software/autoconf/

$ tar -xzvf autoconf-2.69.tar.gz
$ cd autoconf-2.69
$ ./configure --prefix=/usr/local
$ make
$ sudo make install

http://www.gnu.org/software/automake/

$ tar xzvf automake-1.15.tar.gz
$ cd automake-1.15
$ ./configure --prefix=/usr/local
$ make
$ sudo make install

http://www.gnu.org/software/libtool/

tar xzvf libtool-2.4.6.tar.gz
cd libtool-2.4.6
./configure --prefix=/usr/local
make
sudo make install

install php pdo_pgsql

$ php -v

download php-5.5.29.tar.gz from php.net
[php version same current mac]

$ tar -zxvf php-5.5.29.tar.gz
$ cd php-5.5.29/ext/pdo_pgsql
$ phpize
$ ./configure --with-pdo-pgsql=/Applications/Postgres.app/Contents/Versions/9.4/
$ make
$ sudo make install

at this time there will be an install error, because the mac filesystem permission problem, so…

$ cp modules/pdo_pgsql.so /usr/local/lib/

$ vi /etc/php.ini
extension=/usr/local/lib/pdo_pgsql.so
$ sudo apachectl start
$ php -m
<?php
    echo phpinfo();
?>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值