phporacle-databaseoracle10goci8instantclient

oci8, php7 and Oracle 10.1 compatibility


I have to upgrade a system from php5.6 to php7.2. The system uses an oracle 10.1 database.

Now I tried to collect all infos but am still confused about the compatibility between php, oci8, instant client and the database.

I read, that with php7 I have to at least install oci8 2.1, but this doesn't work with oracle 10.1.

Is that correct?

Or is it possible to run php7 with oracle 10.1?

Please enlighten me :)


Solution

  • I read, that with php7 I have to at least install oci8 2.1, but this doesn't work with oracle 10.1.

    Is that correct?

    No. From the manual:

    OCI8 2.0 requires Oracle 12c, 11g or 10g client libraries and will install on PHP 5.2 onwards.

    Note that the Oracle client version you use doesn't need to match the server version. From the same manual page (reformatted into bullet points for ease of reading):

    • If OCI8 uses 9iR2 client libraries, then PHP can connect to Oracle Database 8i, 9iR2, 10g or 11g.
    • If OCI8 uses 10gR2 client libraries, the database can be 9iR2, 10g, 11g or 12c.
    • If OCI8 uses 11g client libraries, the database can be 9iR2, 10g, 11g or 12c.
    • If OCI8 uses 12c client libraries, the database can be 10gR2, 11g or 12c.

    So only the last scenario (12c client libraries) requires a database version greater than 10.1.

    Regardless of what the manual says, I would strongly recommend building a test instance and seeing if you have any issues.


    Edit: Further information from the OCI8 package PECL page:

    Oracle's standard cross-version connectivity applies. For example, PHP OCI8 linked with Instant Client 11.2 can connect to Oracle Database 9.2 onward. See Oracle's note "Oracle Client / Server Interoperability Support" (ID 207303.1) for details.