如何将OCI8安装到现有的PHP?

根据 this(从PECL安装OCI8,自动化),我所要做的就是键入pecl oci8 install.

但这只会让我反复出现以下错误.

没有可用于包pecl.PHP.net/oci8的版本.

一个网站建议我尝试使用pear install pecl / oci8.发生同样的错误.

我该怎么做才能解决这个问题?

我在Ubuntu LTS 14.04上有同样的错误
~$sudo pecl install oci8
No releases available for package "pecl.PHP.net/oci8"
install Failed

最后的原因是代理问题:我的计算机是在公司代理服务器之后.运行以下命令以添加代理

~$sudo pear config-set http_proxy http://proxy.mycompany.com:8080/
config-set succeeded

然后再次运行该命令,它的工作方式如下

~$sudo pecl install oci8
downloading oci8-2.0.8.tgz ...
Starting to download oci8-2.0.8.tgz (190,854 bytes)
....done: 190,854 bytes
11 source files,building
running: PHPize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212

在这里,我们输入Oracle Instant客户端文件夹,如下所示:

Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] : instantclient,/opt/oracle/instantclient_12_1

然后命令行继续输出

building in /tmp/pear/temp/pear-build-rootJafknN/oci8-2.0.8
running: /tmp/pear/temp/oci8/configure --with-oci8=instantclient,/opt/oracle/instantclient_12_1
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
...
...
Build process completed successfully
Installing '/usr/lib/PHP5/20121212/oci8.so'
install ok: channel://pecl.PHP.net/oci8-2.0.8
configuration option "PHP_ini" is not set to PHP.ini location
You should add "extension=oci8.so" to PHP.ini

祝好运.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...