ORA-12504 warning in PHP

追憶丶年華發表於2018-01-16

<?php
$conn = oci_connect('proekt', 'proekt1', 'localhost:1521');

$stid = oci_parse($conn, "select 1+2 as sum from dual");
oci_execute($stid);
$row = oci_fetch_array($stid, OCI_BOTH);
echo $row[SUM];
?>

Warning: oci_connect(): ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA in /var/www/test.php on line 2


$conn = oci_connect('proekt', 'proekt1', ' (DESCRIPTION =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
  )
  (CONNECT_DATA =
    (SERVICE_NAME = proekt)
  )
)');

相關文章