-2
What are the most important conditions for a PHP connection to ORACLE?
I already wrote these extensions in PHP.ini and it didn’t work
extension=oci8_12c ; Use with Oracle Database 12c Instant Client
extension=php_oci8.dll
extension=php_oci8_12c.dll
extension=php_oracle.dll
extension=pdo_odbc
extension=pdo_pgsql
Code used
<?php
$conn="(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.9)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PRD)
(SERVER = DEDICATED)
)//pequei essa parte do TSname
)";
$conexao = oci_connect('DBA', '123', $conn);
if (isset ($conexao) || empty($conexao)){
$erro = oci_error();
trigger_error(htmlentities($erro['erro'], ENT_QUOTES), E_USER_ERROR);
exit;
}
echo"ola";
?>
Mistakes
Fatal error: Uncaught Error: Call to undefined function oci_connect() in C:\wamp64\www\Teste\testes\conexaooracle.php on line 12
Error: Call to undefined function oci_connect() in C:\wamp64\www\Teste\testes\conexaooracle.php on line 12
Possible duplicate of Fatal error: Call to Undefined Function oci_connect()
– Ricardo Lucas