免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2937 | 回复: 4
打印 上一主题 下一主题

神奇,太神奇了,晕死了,请高手解答. [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-29 08:11 |只看该作者 |倒序浏览
#!/usr/bin/perl -w


use CGI;
use DBI;


my $dbh = DBI->connect("dbi:Oracle:host=10.197.104.198;sid=HCPTEST","hcp","hcp");
my $sqr = $dbh->prepare("SELECT * FROM hr.jobs");
$sqr->execute();

$q=new CGI;
print   $q->header(-charset=>"gb2312"),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$q->start_html(),"<div>";
while(my @ref = $sqr->fetchrow_array()) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#my @refo=split(/ /,$refo);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print "$ref[0]$ref[1]$ref[2]$ref[3]\n";
}
print   "</div>",$q->end_html,"\n";
$dbh->disconnect;



[root@es4 gprism]# ./o.cgi
Content-Type: text/html; charset=gb2312

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"><head><title>Untitled Document</title>
</head><body><div>AD_PRESPresident2000040000
AD_VPAdministration Vice President1500030000
AD_ASSTAdministration Assistant30006000
FI_MGRFinance Manager820016000
FI_ACCOUNTAccountant42009000
AC_MGRAccounting Manager820016000
AC_ACCOUNTPublic Accountant42009000
SA_MANSales Manager1000020000
SA_REPSales Representative600012000
PU_MANPurchasing Manager800015000
PU_CLERKPurchasing Clerk25005500
ST_MANStock Manager55008500
ST_CLERKStock Clerk20005000
SH_CLERKShipping Clerk25005500
IT_PROGProgrammer400010000
MK_MANMarketing Manager900015000
MK_REPMarketing Representative40009000
HR_REPHuman Resources Representative40009000
PR_REPPublic Relations Representative450010500
</div></body></html>




权限 755
但是ie访问
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


--------------------------------------------------------------------------------

Apache/2.0.52 (Red Hat) Server at es4 Port 80

其他cgi运行正常
高手帮看看是什么问题

论坛徽章:
0
2 [报告]
发表于 2008-05-29 08:26 |只看该作者
1、建议你不要用这种标题发帖子
2、建议你再看看apache的errlog
3、建议你在各个可能出错的地方 or die "$!\n";

论坛徽章:
0
3 [报告]
发表于 2008-05-29 08:32 |只看该作者
[Thu May 29 08:33:54 2008] [error] [client 10.197.96.97] install_driver(Oracle) failed: Can't load

'/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle:

libocci.so.10.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.5/i386-linux-

thread-multi/DynaLoader.pm line 230.
[Thu May 29 08:33:54 2008] [error] [client 10.197.96.97]  at (eval 1) line 3
[Thu May 29 08:33:54 2008] [error] [client 10.197.96.97] Compilation failed in require at (eval 1) line 3.
[Thu May 29 08:33:54 2008] [error] [client 10.197.96.97] Perhaps a required shared library or dll isn't installed

where expected
[Thu May 29 08:33:54 2008] [error] [client 10.197.96.97]  at /var/www/html/gprism/o.cgi line 4
[Thu May 29 08:33:54 2008] [error] [client 10.197.96.97] Premature end of script headers: o.cgi

晕死,昨天花了半天时间搞定了instant client和DBD:racle,以为搞定了,难道还是有问题?
那为什么直接perl运行能取出数值呢?

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
4 [报告]
发表于 2008-05-29 09:25 |只看该作者
DBD::Oracle有问题..重装吧..

论坛徽章:
0
5 [报告]
发表于 2008-05-29 10:26 |只看该作者
上了一个小时google
解决方法如下:

echo $ORACLE_HOME/lib >> /etc/ld.so.conf   
ldd /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so--查看结果是否正常
httpd.conf:
        SetEnv LD_LIBRARY_PATH /home/oracle/oracle/product/10.2.0/oraclient/lib
        SetEnv ORACLE_HOME /home/oracle/oracle/product/10.2.0/oraclient
重启apache
问题解决

[ 本帖最后由 dong_kof 于 2008-5-29 10:27 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP