dongxie8856 2015-07-07 12:05
浏览 153

为php安装pgsql扩展

As the title mentions, I am trying to add the pgsql extension to php, to be able to call functions like: pg_connect() pg_query() etc. in php. I am using Mac OSX 10.10.1 (Yosemite)

Those are the steps I followed (precisely- and encountered no errors)

  1. Found my version of PHP: php -v.
  2. Downloaded the version of PHP that matches mine: curl -O http://us.php.net/distributions/php-5.5.14.tar.gz.
  3. Extracted the archive I downloaded: tar -xzvf php-5.5.14.tar.gz
  4. Changed to the PostgreSQL's extension directory: cd php5.5.14/ext/pgsql/
  5. Typed phpize (already have autoconf installed)
  6. Typed ./configure --with-pgsql=/Library/PostgreSQL/9.4
  7. Typed make.
  8. Typed sudo make install.
  9. Added the extension to my php.ini file by adding extension=pgsql.so.
  10. Restarted Apache

If I now execute pg functions in php it still comes up with the same error as before: "Fatal error: Call to undefined function pg_connect() in /Applications/XAMPP/xamppfiles/htdocs/connect.php on line 8"

In the terminal php -m, will NOT list pgsql. Maybe someone's got some ideas, what could be going wrong in the install process.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 树莓派与pix飞控通信
    • ¥15 自动转发微信群信息到另外一个微信群
    • ¥15 outlook无法配置成功
    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题