Connecting oracle 12c with php 7.1.7 - php

I have oracle 12c R2 installed and xampp with php 7.1.7. Oracle 12c is 64 bit on my 64 bit windows 10 machine. But xampp is 32 bit.
How do I connect my oracle 12c with php?
Do I need to download oracle 12c 32 bit client and then use oci8?

If XAMPP is 32-bit, then you need 32-bit Oracle client libraries in your PATH since the PHP executable & OCI8 extension will be running as 32-bit.
If you also have a database on the same machine, make sure not to stuff up anything if you change PATH globally. You might need to change PATH just for XAMPP.
The Oracle Net layer between PHP OCI8 and the database will handle any 32-bit to 64-bit data conversions.

Related

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

Connect PHP to Oracle 12c on Oracle Linux 7.2

I have downloaded;
Oracle Linux 7.2
Oracle Database 12c for Linux
Oracle Instance Client for 12c
(All are of the same version)
What I was successful with;
Installing Oracle Linux on VMWare
Installing Oracle Database 12c
I need to;
Install LAMP with the capability of connecting to Oracle Database.
Install Instant Client with the capability of connecting php to Oracle Database.
Install phpmyadmin
Please Help ...
There are PHP RPMs (including one for the PHP OCI8 driver to connect to Oracle Database) at http://yum.oracle.com/oracle-linux-php.html
You will need to install the 'Basic' package from http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html first (this requires a click-through so it can't be in a yum channel). It sounds like you have done this.
There's a lot of useful info about PHP OCI8 in the back half of this free book: http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html

how to connect php to oracle 11g and oracle8

I am on linux redhat 6 enterprise. I have php set up to connect to oracle 11g, I would like to connect it to oracle 8, how can i do this?
I have tried using the current drivers installed but it does not work.
PHP Warning: oci_connect(): ORA-03134: Connections to this server version are no longer supported. in /var/SP/oiadm/docroot/common/php/DatabaseConnection.php on line 112
Your problem is because your client version (which used to compile oci8 you are using) is not compatible with Oracle 8 server.
This is the matrix (image format) for the Oracle client / server interoperabillity:
And the meaning:
Extracted from here <- where is 12 version? I'm trying to get a newer one.

How to make OCI8 uses 9iR2client libraries on Linux?

I need to connect to an Oracle 8i server, but oci8 does not support it by default.
The php documentation says as following:
Note:
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.
How can I setup OCI8 to use 9iR2 client libraries?
My current environment is:
I'm on a ubuntu server,
Oracle 8i version 8.1.7.4.0
I have already installed instantclient libraries(I'm able to connect to oracle 10i and above)
I'm using instantclient version 12.1... Also tried with instantclient version 10.2
Could someone help me figuring out what the problem might be and how to solve it? Any help is really appreciated.
Thank you

Wampserver - mssql - 64 bit to 32 bit

I currently have a wampserver setup on a virtual server, its running apache 2.2.22, php 5.4.3, 64 bit.
I've decided its best for our system to connect to our large mssql database using PDO rather than odbc.
Our problem is that we have our 64 bit servers running 64 bit php. We've installed the sqlsrv (PDO) drivers, enabled the extensions etc etc, but it doesn't seem to be registering with PHP. Looking further into it, it seems the sqlsrv drivers are 32bit and incompatable with 64bit windows.
My question is,
Is there a 64 bit version of the sqlsrv drivers for PDO?
If there isn't, how easy would it be to convert our 64 bit wampserver to a 32bit wampserver?
Thanks

Categories