0
Error connecting to Oracle database. Below is the code in PHP:
<?php
$ora_bd = "(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)
(HOST=192.168.0.249)(PORT=1521)
)
)
(CONNECT_DATA=(SERVICE_NAME=CSTESTE))
)";
$ora_conexao = oci_connect('refeitorio', 'tiete2018', $ora_bd);
if (!$ora_conexao) {
$erro = oci_error();
trigger_error(htmlentities($erro['message'], ENT_QUOTES), E_USER_ERROR);
exit;
}else{
echo "Conectado com Sucesso.";
}
Recalling that I have already enabled the following commands on php.ini
extension=php_oci8.dll
extension=php_pdo_oci.dll
extension=php_oracle.dll
The following error appears:
Fatal error: Uncaught Error: Call to Undefined Function oci_connect() in C: wamp64 www Sistema Refeicao Core Testecon.php:11 Stack trace: #0 {main} thrown in C: wamp64 www Sistema Refeicao Core Testecon.php on line 11
This error happens when the extension has not been installed. Only enable
php.ini
not enough. There’s something else you did?– gmsantos
Already installed instantclient on your system? https://answall.com/a/71364/4751
– gmsantos
I already have the client installed on my machine. I use this client because I have 2 software using Oracle, path: C: oracle product 10.2.0 client_1
– user31040
what version of your php?
– Julio Henrique
5.6.31, but also tried version 7.0.23
– user31040
@J.C.Galhardi version 7 is only compatible with Instant client 12, be careful with it! I advise you to check all the steps I gave you and send me all the versions of everything you installed (client, php etc) and tb print of the environment variables configured
– Julio Henrique
Was inside apache bin or inside bin/php/ext/ ???
– Kleidson da Silva
I was able to put the Instant Client path ("C: instant_client") in the System Variables PATH and restart the PC.
– Kleidson da Silva
In my case I needed to install XAMPP in 32 bit version. Download version of XAMPP 32 Bits
– Lucas Borelli
This solution works for Oracle 10.2.0 as well, but for this you need to download the instantclient. I used the instantane19.
– Vanderlei Luis Conrad Weber