oci8, php7 and Oracle 10.1 compatibility

风格不统一 提交于 2019-12-12 19:15:26

问题


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 :)


回答1:


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.



来源:https://stackoverflow.com/questions/50791815/oci8-php7-and-oracle-10-1-compatibility

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!