我有以下脚本用于在 Linux 中使用 PHP 检查 Oracle 数据库连接:
<?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
我该如何解决它,问题是什么?