How do I connect to a remote Oracle database instance from PHP?
I need to query (read only) the remote Oracle database for some information; do I need to have an Oracle Instant Client installed?
Is the OCI extension for PHP enough?
To use the Easy Connect naming method, PHP must be linked with Oracle 10g or greater Client libraries. The Easy Connect string for Oracle 10g is of the form: [//]host_name[:port][/service_name]. From Oracle 11g, the syntax is: [//]host_name[:port][/service_name][:server_type][/instance_name].
To connect to Oracle Database from SQL*Plus: If you are on a Windows system, display a Windows command prompt. At the command prompt, type sqlplus and then press the key Enter. At the user name prompt, type your user name and then press the key Enter.
You can use the SQL Gateway from the ODBC Driver for Oracle to query Oracle data through a MySQL interface.
Now as influential as it may be, Oracle Database is not supported out of the box by Laravel. However, like a lot of things that are not supported out of the box, we can actually make Laravel work with Oracle Database. PHP has had support for Oracle Database since 2003 through the OCI8 PHP extension.
From PHP Manual
You will need the Oracle client libraries to use this extension.
The most convenient way to install all the required files is to use Oracle Instant Client, which is available from Oracle's site
The best manual for using PHP with Oracle is Underground PHP Oracle Manual. Periodically updated. For example last update describe new cool OCI (Oracle Call Interface) features. I found it by accident and since then has never regretted. Start from that good manual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With