我是这样做的:
1,设置php.ini文件,将extension=php_oci8.dll和extension=php_oracle.dll前的分号都去掉
2,把php_oci8.dll拷贝到windows2000   server安装目录下的system32子目录,重新启动数据库的用户名和密码都是tzsb,SID为:orcl.php文件是这样的:
<?php
$user = "tzsb";
$password = "tzsb";
$conn_str = "orcl";
$conn = OCILogon($user, $password, $conn_str);
// $conn = OCILogon("weather","information");
$stmt = OCIParse($conn,"select * from zjl_testtable");
/* ê1ó? OCIDefineByName òa?ú?'DD OCIExecute ?° */
OCIDefineByName($stmt,"n_zh",&$empno);
OCIDefineByName($stmt,"c_zm",&$ename);
OCIExecute($stmt);
while (OCIFetch($stmt))
{
echo "n_zh:".$empno."\n";
echo "c_zm:".$ename."\n";
}
OCIFreeStatement($stmt);
OCILogoff($conn);
?>但是出错:
Warning: _oci_open_server: ORA-12154: TNS:could not resolve service name in c:\apache\htdocs\1\conn_cracle.php on line 5Warning: Supplied argument is not a valid OCI8-Connection resource in c:\apache\htdocs\1\conn_cracle.php on line 7Warning: Supplied argument is not a valid OCI8-Statement resource in c:\apache\htdocs\1\conn_cracle.php on line 9Warning: Supplied argument is not a valid OCI8-Statement resource in c:\apache\htdocs\1\conn_cracle.php on line 10Warning: Supplied argument is not a valid OCI8-Statement resource in c:\apache\htdocs\1\conn_cracle.php on line 11Warning: Supplied argument is not a valid OCI8-Statement resource in c:\apache\htdocs\1\conn_cracle.php on line 12Warning: Supplied argument is not a valid OCI8-Statement resource in c:\apache\htdocs\1\conn_cracle.php on line 17请大家告诉我,我还少做了什么?怎么样更改代码才能连接上?