问题描述
我尝试安装OCI,因此可以使用新的PDO("oci:dbname ...
I've tried to install OCI, so I can use new PDO("oci:dbname...
战斗1.5小时后,我安装了oracle Instantclient(基本和SDK),然后安装了php的oci(如此处所述 http://ubuntuforums.org/showthread.php?t=92528 ).
After 1,5h of fight I've installed oracle instantclient (basic and sdk) and then oci for php (as described here http://ubuntuforums.org/showthread.php?t=92528).
现在我有些困惑,因为我的PHPinfo告诉我启用了OCI8支持,但是在PDO部分中,"PDO驱动程序"部分中只有odbc.
Now I'm a bit confused because my PHPinfo tells that OCI8 Support is enabled, but in PDO section there's only odbc in "PDO drivers" section.
我什么时候出错了?
P.S.我已经安装了XUBUNTU 12.10和以下数据包:php-pear,php5,php5-cli,php5-common,php5-dbg,php5-dev,php5-odbc
P.S.I've got XUBUNTU 12.10 and following packets installed:php-pear, php5, php5-cli, php5-common, php5-dbg, php5-dev, php5-odbc
感谢您的解释.现在,我正在尝试按照以下步骤安装"pdo_oci": http://lacot.org/blog/2009/11/03/ubuntu-php5-oci8-and-pdo_oci-the-perfect-install.html
Thanks for explaining. Now I'm trying to install "pdo_oci" following this:http://lacot.org/blog/2009/11/03/ubuntu-php5-oci8-and-pdo_oci-the-perfect-install.html
现在调用此:
我遇到以下错误:
我想知道在Windows上这样做是否会更容易.
I wonder if doing this on Windows wouldn't be easier.
推荐答案
您应该注意,有两个完全不同的PHP扩展旨在连接到Oracle数据库:
You should note that there're two completely different PHP extensions designed to connect to Oracle databases:
-
OCI8 是Oracle Corporation开发的扩展.它是积极维护的,并且是与Oracle进行交互的推荐方法.
OCI8 is the extension developed by Oracle Corporation. It's actively maintained and it's the recommended way to interact with Oracle.
PDO_OCI 是由社区开发的PDO驱动程序.它从未完成过,实际上已经被放弃了(因此文档中显示了 EXPERIMENTAL 警告).
PDO_OCI is the PDO driver developed by the community. It was never finished and it's actually kind of abandoned (thus the EXPERIMENTAL warning displayed in the documentation).
两者都包含OCI
(Oracle调用接口)术语,因为两者均在内部使用Oracle提供的OCI API.因此,无论选择哪种库,都需要Oracle Instant Client.但是然后您需要安装相应的PHP软件包.
Both contain the OCI
(Oracle Call Interface) term because both make use internally of the OCI API provided by Oracle. As such, you need the Oracle Instant Client no matter what library you choose. But you then need to install the corresponding PHP packages.
以您为例,您正在安装OCI8,然后尝试运行PDO代码.
In your case, you're installing OCI8 and then trying to run PDO code.
这篇关于启用PDO OCI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!