Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Chris Jones:
Adding DTrace Probes to PHP Extensions
Dec 07, 2012 @ 15:35:09

In a new post to his site (related to the topic of this previous post) Chris Jones shows you how to setup and use DTrace support in your PHP installation for enhanced debugging abilities.

The powerful DTrace tracing facility has some PHP-specific probes that can be enabled with --enable-dtrace. DTrace for Linux is being created by Oracle and is currently in tech preview. Currently it doesn't support userspace tracing so, in the meantime, Systemtap can be used to monitor the probes implemented in PHP. This was recently outlined in David Soria Parra's post Probing PHP with Systemtap on Linux.

His examples are using the Oracle flavor of linux, but they should work for just about any unix-based system out there. He installs the tool via a yum package and compiles the latest PHP source with the "enable-dtrace" flag. He includes a simple script to connect to an Oracle database and shows the contents of the resulting "functrace.stp". He also shows how he added more "prodbes" (the points DTrace uses to profile) into the OCI8 extension for PHP (steps and source included).

tagged: dtrace extension probe tutorial compile oci8 extension

Link:

Chris Jones' Blog:
PHP 5.3.8 RPMs are on oss.oracle.com
Aug 31, 2011 @ 13:40:06

Chris Jones has posted a quick note to his blog today about some new PHP packages that are available from Oracle of 5.3.8 (RPM) with one of the latest OCI8 extensions already included.

I've built PHP 5.3.8 RPM packages with various common extensions (and the latest OCI8 1.4.6) for Linux x64. They are downloadable at oss.oracle.com/projects/php/. These binaries might be useful for quick testing. They are unsupported.

He points to packages on the ULN site if you're looking for something a bit more stable. The OCI 1.4.6 version of the extension includes a few new features but was mostly a test suite update.

tagged: oracle oci8 extension rpm package download

Link:

Chris Jones' Blog:
PHP OCI8 and Oracle 11g DRCP Connection Pooling in Pictures
Feb 22, 2011 @ 16:44:46

Chris Jones has posted some "pictures" of the performance that an Oracle database sees when it uses the connection pooling versus the normal connect/allocate sort of connection with the Oracle OCI8 driver for PHP. As you can see, the differences in memory consumption are huge.

Here is a screen shot from a PHP OCI8 connection pooling demo that I like to run. It graphically shows how little database host memory is needed when using DRCP connection pooling with Oracle Database 11g. Migrating to DRCP can be as simple as starting the pool and changing the connection string in your PHP application.

He also describes the differences between the pooled and non-pooled connections (to the developer it's as easy as putting ":pooled" in the connect string) in his graphs, and notes that using the pooling doesn't just have to be for large site - smaller sites can benefit too.

tagged: oci8 oracle connection pooling performance graph result

Link:

Chris Jones' Blog:
PECL OCI8 1.4.4 is Available
Nov 11, 2010 @ 16:12:55

As Chris Jones has mentioned in a new post to his blog, the latest release of the Oracle OCI8 drivers for PHP has been released on PECL (version 1.4.4).

PECL OCI8 1.4.4 has just been released. It fixes a potential memory corruption using oci_set_* functions seen on 64 bit machines. This release can be used to update OCI8 on earlier PHP versions.

He talks about an error he's come across many times - "Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed" - and how it can be fixed with an environment setting. He updated the error message in this new version to be a bit more descriptive and help lead others to the problem more quickly.

tagged: pecl oracle oci8 driver release error message

Link:

Oracle Technology Network:
PHP Web Auditing, Authorization and Monitoring with Oracle Database
Sep 13, 2010 @ 19:10:25

On the Oracle Technology Network today there's a new article from Chris Jones about using the client identifier in the OCI8 PHP-to-Oracle connections to help with auditing, profiling and monitoring your Oracle database usage.

This "client identifier" can be used by Oracle Database to distinguish between individual web application users who all connect to the database using one common set of database credentials. For example, every page in a web site might physically connect to the database as the same database user PHPUSER. If two different people 'Chris' and 'Alison' are using the site, these two user names can be set as their respective client identifiers and be passed into the database.

He shows how to set these client identifiers via the oci_set_client_identifier function (and how you could use it in older versions of the OCI8 driver too). He provides a sample application to help you get a good overall picture complete with SQL to load the database and a basic login page to submit and pull that data back out.

He moves over to the database side where he talks about enabling auditing, pulling out the logged application ID and how to use this identifier to restrict access via a Virtual Private Database on the Oracle side.

tagged: authorization monitoring auditing oracle database oci8

Link:

Chris Jones' Blog:
PHP OCI8 1.4.3 is Available on PECL
Aug 10, 2010 @ 16:40:38

Chris Jones has a new post to his Oracle blog about the latest release of the OCI8 for PHP drivers to connect Oracle and PHP - version 1.4.3 - now available on PECL.

Why the two releases so close in time? The OCI8 extension is one of the few extensions that has a dual identity, being in both the PHP bundle and in the PECL repository. OCI8 1.4.2 contains the same code as in the recent PHP 5.3.3 release. The PECL bundle was made for anyone who wants a PHP 5.5.3-identical version of OCI8 when installing via PECL.

He describes some of the bugfixes that comes with this release (and what specific circumstances if effects) as well as the requirements you'll need to be able to upgrade to this new version.

tagged: pecl oci8 oracle upgrade

Link:

Chris Jones' Blog:
Using PHP OCI8 with 32-bit PHP on Windows 64-bit
Jun 15, 2010 @ 17:14:31

Chris Jones has a new post to his blog today showing how to use the latest 32-bit OCI8 (Oracle) drivers in a 64-bit Windows environment (like on Windows 7 or similar OSes).

The world migration from 32-bit to 64-bit operating systems is gaining pace. However I've seen a couple of customers having difficulty with the PHP OCI8 extension and Oracle DB on Windows 64-bit platforms. The errors vary depending how PHP is run. They may appear in the Apache or PHP log. [...] Other than IIS permission issues a common cause seems to be trying to use PHP with libraries from an Oracle 64-bit database on the same machine. There is currently no 64-bit version of PHP on http://php.net/ so there is a library mismatch.

The solution is to install the Oracle Instant Client, move a few files around, edit your path and you should be good to go.

tagged: oci8 driver oracle windows 32bit 64bit

Link:

Gennady Feldman's Blog:
My recent learnings with Oracle Instant Client and OCI8 API
May 14, 2010 @ 14:53:45

Gennady Feldman recently spent some time doing some upgrades on his Oracle servers and, in doing so had a chance to work with the latest release of their Instant Client and how it interacts with the OCI8 extension's API.

I was recently involved in upgrading our Application servers to the latest Oracle Instant Client 11.g (11.2.0.1) including installing the latest PHP OCI8 module (1.4.1). Currently Oracle provides binaries for Linux in RPM and ZIP(?) format. (Side note: It still puzzles me as to why Oracle uses ZIP files for Linux binaries as ZIP is common to Windows and is not always available or generally used on Linux.)

He had everything prepared for the move and thought things would go smoothly during the upgrade but was surprised by a few things - the RPMs that Oracle gives are broken, an issue on the pecl update for the oci8 extension and a problem that came up with dependencies and packages for the Instant Client.

tagged: oracle upgrade instant client pecl oci8 api issue

Link:

Chris Jones' Blog:
Tracing PHP Oracle Applications, part 1
Jan 20, 2010 @ 18:50:45

Chris Jones (of Oracle) has a new post to his OTN blog with a look at tracing in Oracle+PHP applications via some new methods added to the OCI8 extension.

No matter how it was installed, the PHP OCI8 extension provides a procedural API with familiar calls allowing efficient SQL and PL/SQL execution. The extension also supports some advanced Oracle features such as connection pooling. Recently some new OCI8 functions were checked into the PHP source code.

The new functions - oci_set_module_name, oci_set_action and oci_set_client_info - can be used on any existing (or new) Oracle connection to provide a bit more information about what's going on inside. You can get access to this information via the data dictionary views or through the SYS_CONTEXT() function in your SQL statements.

tagged: trace oracle oci8

Link:

Chris Jones' Blog:
PHP OCI8 1.4.0 Alpha is now available
Oct 07, 2009 @ 14:01:42

Chris Jones has officially launched the latest OCI8 (Oracle) drivers for PHP - version 1.4.0 Alpha:

I just released an Alpha version of PECL OCI8 1.4 on http://pecl.php.net/package/oci8 The code is also merged to what will eventually be the PHP 5.3.2 and PHP 6.0 releases. Documentation will appear on http://www.php.net/manual/en/ref.oci8.php in the next few days, if all goes according to plan.

Updates in this alpha release include a few new connection attribute functions, a change in the driver name for 11gRD2 connections and a correction of a bug in the oci_bind_by_name error handling.

tagged: alpha oci8 driver release oracle

Link:


Trending Topics: