Wez Furlong I am Wez Furlong, Chief Software Architect at Message Systems. We're responsible for building an awesome Messaging Platform.

I'm also a PHP Core developer and OpenSource contributor, residing in Maryland, USA with Juliette, Xander and Lily. (read more)

Subscribe. (circulation 964)
Comments. (circulation 11)

Search powered by Google

Updated oci8 extension now in PECL

7th September 2005 @ 13:28 EDT

You may have heard of the Zend Core for Oracle; as part of that project the oci8 extension for PHP received a lot of attention from teams of people from Zend, Oracle and OmniTI. As a result, the oci8 extension is now more robust, performant, better documented and more thoroughly tested than ever before (the list of closed bugs is enourmous).

Although the extension is currently marked as beta, it's a significant improvement over the older versions that have shipped with PHP.

The updated code is available now via PECL, and will compile against PHP 4 and PHP 5 (Windows users can obtain the updated extension DLL via snaps).

Installation on unix should be as simple as:

   # pear install oci8-beta

However, if you compiled the oci8 extension statically, you will need to recompile PHP using --with-oci8=shared (or --without-oci8) before this will work.

Updated documentation will be appearing at your local PHP documentation mirror as soon as the manual build finishes.

Many thanks to Antony Dovgal for doing the lions share of the implementation and testing; good work Tony!

by Wez Furlong in .
Post a comment

Worth mentioning the new --with-oci8 syntax?

7th September 2005 @ 20:09 EDT

Thanks Wez & Antony for refactoring the extension!

The configure options have been improved and the --with-oci8-instant-client option has been combined with --with-oci8.

To configure the refactored oci8 driver with Oracle Instant Client I used:

--with-oci8=yes,instantclient,/path/to/instantclient_10_2

-- CJ

by cj in .

I'm confused.. compile with or without?

1st December 2005 @ 05:57 EDT

Hi Wez,

I would like to ask you about what you wrote:

"you will need to recompile PHP using --with-oci8=shared (or --without-oci8) before this will work."

I compiled PHP 5.0.4 with "--with-oci8=<ORACLE_HOME>". Then I installed OCI8 v1.1.1.

I'm not sure v1.1.1 is working (since http://bugs.php.net/bug.php?id=29779 is not solved for me). Are you saying I need to recompile PHP with "--without-oci8" so the new OCI8 would work? I don't understand, I'm confused..

Could you please explain?

Thanks, Tom.

by Tom in .

One more thing..

1st December 2005 @ 06:45 EDT

Hi Wez,

Just to add, my phpinfo shows $Revision: 1.257.2.6 $ and not 1.274 as I read in http://bugs.php.net/bug.php?id=35205.

Does that imply that the OCI8 v1.1.1 wasn't installed correctly or needed I recompile it as you wrote (although I didn't see this requirement in any documentation)?

Thanks, Tom.

by Tom in .

Build shared (or not all) to be able to upgrade via PECL

1st December 2005 @ 12:35 EDT

You either need to build PHP with shared OCI support, or no OCI support at all, if you want to be able to use PECL to upgrade the OCI support via the PECL tool. The reasoning is simple: if you build OCI support statically into PHP, you can't load the shared version of the extension, because it's already built into your PHP.

Can it be built static?

4th December 2005 @ 19:41 EDT

Hi Wez,

Thanks for your prompt response. I understood that using static OCI8 module gives the best performance hence I built the PHP with the option I mentioned in my previous comment.

Is it possible to somehow build PHP with OCI8 v1.1.1 as static module?

How is the performance degrades if using OCI8 as shared module?

What about CJ's suggestion to use: --with-oci8=yes,instantclient,/path/to/instantclient_10_2?

Thanks so much for your help :) Tom.

by Tom in .

Shipping with PHP 5.1.2

4th December 2005 @ 19:51 EDT

The improved driver will be shipping with PHP 5.1.2; you can try out the stable 5.1 snapshot from http://snaps.php.net; this is PHP 5.1.1 with only bug fixes applied.

Alternatively, you can take your PHP source distribution and remove ext/oci8, then extract the new improved code in its place. Run "./buildconf --force" from the root of the source distribution to rebuild configure, and you can then build the extension statically into your build of PHP.

As for performance difference, some people have reported bad performance with shared builds, but this should not be an issue in more recent versions of PHP, where the compiler options have been tweaked to avoid this.

Thanks so much :)

6th December 2005 @ 02:08 EDT

Hi Wez,

Good news! I have managed to build PHP 5.0.4 with OCI8 v1.1.1 statically.

Everything is working smoothly :)

Thanks so much for your help.

For readers who need the same, when you extract oci8-1.1.1.tgz, you'll see a directory called 'oci8-1.1.1'. I did not copy the directory to '/ext' to replace '/ext/oci8', I just removed all files from '/ext/oci8' and copied the files under 'oci8-1.1.1' to '/ext/oci8'. From there you should follow Wez's guidance (you can also use this link: http://www.php.net/manual/en/install.pecl.static.php)

Tom.

by Tom in .
Post a comment

Would you like to work with me?
I have positions open for server/infrastructure software development (C) and QA.

Ohloh profile for wez