php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57351 Unable to install PDO_OCI
Submitted: 2006-11-07 06:09 UTC Modified: 2015-08-29 12:33 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: nicolas dot ternisien at gmail dot com Assigned: cmb (profile)
Status: Closed Package: PECL (PECL)
PHP Version: 5.1.6 OS: Linux/Ubuntu
Private report: No CVE-ID: None
 [2006-11-07 06:09 UTC] nicolas dot ternisien at gmail dot com
Description:
------------
If you try to do :

pecl install pdo

Add extension=pdo.so into /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini

Then restart Apache2

And if you try to do a

pecl install pdo_oci

Then you will have the following error :

pear/PDO_OCI requires PHP extension "pdo" (version >= 1.0)
No valid packages found
install failed



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-27 09:39 UTC] bjoern dot mueller at ivz dot de
workaround: try to build pdo_oci on your own.

pecl download pdo_oci
tar -cf PDO_OCI-1.0.tar
cd PDO_OCI-1.0
./configure --prefix=/usr/local --with-pdo-oci=instantclient,/usr/local/instantclient,10.2.0.3

you will need to download and untar the oracle instanclient (basic and sdk) from oracle homepage into /usr/local/instantclient

if you receive an error ("to dumb to figure out where oci.h is") vi the configure script and modify the searchpath for the oracle headerfiles (in my case they were found in /usr/local/instantclient/sdk).

if your make exits with an error "cannot find -lclntsh" try

1. to symlink libclntsh.so.10.1 in /usr/local/instanclient to libclntsh.so
2. to add /usr/local/instantclient to your /etc/ld.so.conf and run ldconfig
3. to vi the configure script again and edit the PDO_OCI_LIB_DIR (PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX")

remember to make clean and configure again if you edit the configure script. 

last step is to copy the extension (./modules/pdo_oci.so) to php extension_dir and to add "extension=pdo_oci.so" to php.ini ...

here is my diff configure script:

uppsala:/tmp/PDO_OCI-1.0 # diff configure.save configure
3962c3962
<     if test -f $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client/oci.h ; then
---
>     if test -f $PDO_OCI_IC_PREFIX/sdk/include/oci.h ; then
3964c3964
<   if test "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" != "/usr/include"; then
---
>   if test "$PDO_OCI_IC_PREFIX/sdk/include" != "/usr/include"; then
3966,3967c3966,3967
<   if test -z "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" || echo "$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client" | grep '^/' >/dev/null ; then
<     ai_p=$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client
---
>   if test -z "$PDO_OCI_IC_PREFIX/sdk/include" || echo "$PDO_OCI_IC_PREFIX/sdk/include" | grep '^/' >/dev/null ; then
>     ai_p=$PDO_OCI_IC_PREFIX/sdk/include
3970c3970
<     ep_dir="`echo $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client|$SED 's%/*[^/][^/]*/*$%%'`"
---
>     ep_dir="`echo $PDO_OCI_IC_PREFIX/sdk/include|$SED 's%/*[^/][^/]*/*$%%'`"
3973c3973
<     ai_p="$ep_realdir/`basename \"$PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/client\"`"
---
>     ai_p="$ep_realdir/`basename \"$PDO_OCI_IC_PREFIX/sdk/include\"`"
4035c4035
<     PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib"
---
>     PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX"
uppsala:/tmp/PDO_OCI-1.0 #

best regards

bjoern
 [2007-04-27 11:26 UTC] wez@php.net
Just use the pdo_oci that comes with PHP, as it is newer than the one in pecl.
 [2007-04-29 13:35 UTC] nicolas dot ternisien at gmail dot com
The question is how to make it work easily with the Debian packaging of instantclient of Oracle (http://oss.oracle.com/debian)

Does the pdo_oci version provided by PHP can be installed by default on an Ubuntu installation, or does it still need a pear/pecl install pdo_oci ?

Thanks for your answers
 [2007-04-30 08:06 UTC] bjoern dot mueller at ivz dot de
pecl/pear installation of pdo_oci is not stable at the moment on any linux i have tested so far and if you dont want to spend a whole bunch of time in investigating confscripts details just grab php5 tarball and instantclient basic/sdk zips and install from source. 

if you want your paketmanager to know about it you would have to install php source rpm for your dist, vi the specfile, build and install your own rpm.

best regards 

bjoern.
 [2008-09-12 13:16 UTC] jcfiala at gmail dot com
BTW: This is a really useful page for getting pdo_oci installed - thanks for writing it all down!
 [2015-08-28 13:16 UTC] cmb@php.net
-Status: Open +Status: Closed -Package: PDO_OCI +Package: PECL -Assigned To: +Assigned To: cmb
 [2015-08-28 13:16 UTC] cmb@php.net
As the PECL package is not maintained anymore, I'm closing this
ticket.
 [2015-08-29 12:33 UTC] sixd@php.net
Use the PDO_OCI included in core PHP.  As cmb says, the standalone pecl package is obsolete.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jul 08 02:01:27 2020 UTC