我快失去信心................希望有空的朋友帮忙

duwucna 2003-10-16 12:47:28
I want connect oracle9 with php script,flowing is the code,I'm used countless time on this problem,Friends,Do you have other ideas???helpme wating...thanks
Os:Linux8
PHP,APache:4.3.2 and 1.3.x
This is when i start the lsnrctl get error:
Alias LISTENER
Version TNSLSNR for Linux: Version 9.2.0.1.0 - Production
Start Date 16-OCT-2003 09:22:13
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /opt/oracle/product/9.2.0/network/admin/listener.ora
Listener Log File /opt/oracle/product/9.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux-server)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "new" has 1 instance(s).
Instance "new", status UNKNOWN, has 1 handler(s) for this service...
Service "web" has 1 instance(s).
Instance "web", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

status UNKNOWN , why ??????


PHP Code:
<?php
putenv("ORACLE_SID=new");
putenv("ORACLE_HOME=/opt/oracle/product/9.2.0");
putenv("ORA_NLS=/opt/oracle/product/9.2.0/ocommon/nls/admin/data");
putenv("ORA_NSL32=/opt/oracle/product/9.2.0/ocommon/nls/admin/data");
if($conn = ocilogon("kong","kong","new")){
echo "Connecting ok!";
} else {
echo "Die!";
}
$sql = "select * from ADMINUSER";
$stmt = OCIParse($conn,$sql);
ociexecute($stmt);
//echo "is : ".OCIError($conn);
//while(OCIFetchInto($parsed,$result)):
// echo "<br>User:".$result[0];
//endwhile;
//OCIFreeStatement($parsed);
?>
occur error:
Warning: ocilogon(): _oci_open_server: ORA-12154: TNS:could not resolve service name in /usr/test/ora.php on line 6
Die!
Warning: ociparse(): supplied argument is not a valid OCI8-Connection resource in /usr/test/ora.php on line 12

Warning: ociexecute(): supplied argument is not a valid OCI8-Statement resource in /usr/test/ora.php on line 13

...全文
26 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
boystones 2003-10-19
  • 打赏
  • 举报
回复
学习
nie173 2003-10-19
  • 打赏
  • 举报
回复
我没有用过oracle9,帮不上忙
vanrest 2003-10-19
  • 打赏
  • 举报
回复
day day up
跟着学习!

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧