PHP启动:oci8:无法初始化模块

时间:2014-09-23 08:45:35

标签: php oracle apache oci8

我一直在尝试将oci8扩展添加到PHP但是当我尝试查看一切正常时,在控制台中运行php命令我有这样的错误:

PHP Warning:  PHP Startup: oci8: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0
你能帮帮我吗?我有OSX 10.9.4

1 个答案:

答案 0 :(得分:3)

所以我解决这个问题的方法是在我的mac上编译oci8库,以便拥有相同数量的API:

pear download pecl/oci8
tar xvzf oci8-1.4.5.tgz
cd oci8-1.4.5
phpize
./configure --with-oci8=shared,instantclient,/usr/local/lib
make all install

我也按照本网站上的说明进行操作:github