Ubuntu – Trying to install pdo_oci via PECL fails asking for PDO extension

linuxmintoraclepdoPHPUbuntu

I'm using Linux Mint 11 (based on Ubuntu 11.04) and I need to use PHP with Oracle through PDO, a requirement of the framework we will work with.

I've installed various PDO extensions using the normal apt-get method, like php5-mysql, etc, and they loaded just fine, along with the initial PDO extension. But there's no package for Oracle bindings.

So, when I try to run sudo pecl install pdo_oci it throws me this:

WARNING: "pear/PDO_OCI" is deprecated in favor of "channel://http://www.php.net/pdo_oci/ext/pdo_oci"
pear/PDO_OCI requires PHP extension "pdo" (version >= 1.0)
No valid packages found
install failed

How can I add this channel, or is there a better way to install the PDO_OCI extension?

Best Answer

You can add a channel using pecl channel-add.

From the sounds of the error message, it may just be that you don't have the php PDO extension installed.

Depending on which package manager you use, it should be fairly straightforward to install, e.g. yum install php-pdo