如何将OCI8安装到现有的PHP? [英] How do I install OCI8 to an existing PHP?

查看:252
本文介绍了如何将OCI8安装到现有的PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

According to this (Installing OCI8 from PECL, automated), all I have to do is type in pecl oci8 install.

但这只会让我反复遇到以下错误.

But that only gets me the following error, repeatedly.

No releases available for package pecl.php.net/oci8.

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

Another website suggested that I try pear install pecl/oci8. Same error happens.

该如何解决?

推荐答案

我在Ubuntu LTS 14.04上有相同的错误:

I have the same error on Ubuntu LTS 14.04:

~$ sudo pecl install oci8
No releases available for package "pecl.php.net/oci8"
install failed

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

Finally the reason is the Proxy problem: my computer is sitting after the company proxy server. Run the following command to add the proxy

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

然后再次运行该命令,它的作用类似于波纹管

Then run the command again, it works as bellow

~$ 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 Client文件夹:

Here we type in the Oracle Instant client folder as bellow:

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

然后在命令行继续输出:

Then the command line continue ouputs:

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

祝你好运.

这篇关于如何将OCI8安装到现有的PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆