2

I'm trying to compile PHP 5.5.7 on an Ubuntu 12.04 with ubuntu precise partner repository enabled to allow to install IBM DB2 from db2exc package.

When I configure PHP with pdo ibm

source /home/db2inst1/sqllib/db2profile   
./configure   
    --prefix=/opt/php
    --enable-mbstring
    --enable-bcmath
    --enable-pcntl  
    --enable-exif  
    --enable-calendar  
    --enable-opcache  
    --enable-pdo  
    --enable-sysvmsg  
    --enable-sysvsem  
    --enable-sysvshm  
    --enable-wddx  
    --with-curl  
    --with-mcrypt  
    --with-iconv  
    --with-openssl  
    --with-gettext=/usr  
    --with-ibm_db2=/opt/ibm/db2/V9.7 
    --with-pdo-ibm=/home/db2inst1/sqllib

I get this WARNING:

configure: WARNING: unrecognized options: --with-pdo-ibm

http://php.net/manual/en/ref.pdo-ibm.php

After compile it, it don't works:

$conn = new PDO("ibm:DEVELOP", "db2inst1", "ibmdb2", [
    PDO::ATTR_PERSISTENT => TRUE,
    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
    ]
  );

PHP Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /home/vagrant/test/pdo_ibm.php:9

Using db2_connect works fine:

$conn = db2_connect('DEVELOP', 'db2inst1', 'ibmdb2');

$conn value:

resource(4) of type (DB2 Connection)

any help will be appreciated :)

corretge
  • 217
  • 3
  • 9

0 Answers0