PDO_OCI driver for Linux RedHat

Good day,

My webapp is installed in a Red Hat Enterprise Linux Server release 6.4, using an Oracle DB.

The exception that i obtain is: [color="#FF0000"]CDbConnection failed to open the DB connection: could not find driver[/color]

This happens because im missing the driver PDO_OCI.so

Since i can’t download the binary file, i downloaded the source of it… but my problem is that i can’t compile it since my PHP version is 5.3.3 and i can’t use the phpize command to prepare the build environment…

when i run the command to install phpize:

[color="#8B0000"]$ yum install php-devel[/color]

I get this message:

[color="#FF0000"][b]Setting up Install Process

No package php-devel available.

Error: Nothing to do[/b][/color]

tried to run with [color="#8B0000"]php53-devel[/color] and get the same error…

Didn’t have problems with OCI8 driver since it came with Lampp server by default… but i really need the PDO_OCI.so.

Is there a way to install the phpize or compiling (without the phpize) the source to get .so file?

Thank you for your patience.

Best regards.

Solved it…

i did have the phpize installed…

[color="#8B0000"]$whereis phpize[/color]

and obtained:

[color="#2E8B57"]phpize: /opt/lampp/bin/phpize[/color]

then…

[color="#8B0000"]$cd /tmp/PDO_OCI-1.0[/color]

since my instantClient version is 12.1, needed to edit the config.m4 file and added these lines:

[color="#8B0000"][b]elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.12.1; then

PDO_OCI_VERSION=12.1[/b][/color]

[color="#8B0000"][b]12.1)

    PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)


    ;;[/b][/color]

after it, and since my php version is 5.5.11, needed to run this command in the same directory:

[color="#8B0000"]$ sed -i -e ‘s/function_entry pdo_oci_functions/zend_function_entry pdo_oci_functions/’ pdo_oci.c[/color]

and then,

[color="#8B0000"][b]$ ./configure --with-php-config=/opt/lampp/bin/php-config --with-pdo-oci=instantclient,/usr,12.1

[/b][/color]

[color="#8B0000"][b]$ make

[/b][/color]

[color="#8B0000"][b]$ make install

[/b][/color]

with that, my pdo_oci.so was generated in php extensions directory… added line in php.ini to enable the lib, restart lampp and voilá! :D