根据this(自动从PECL安装OCI8),我要做的就是键入pecl oci8 install
。
但这只会让我反复遇到以下错误。No releases available for package 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 Client文件夹:
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
祝你好运。
关于php - 如何将OCI8安装到现有的PHP?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21132227/