神奇,太神奇了,晕死了,请高手解答.

神奇,太神奇了,晕死了,请高手解答.

#!/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"),
                $q->start_html(),"<div>";
while(my @ref = $sqr->fetchrow_array()) {
                #my @refo=split(/ /,$refo);

                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运行正常
高手帮看看是什么问题
1、建议你不要用这种标题发帖子
2、建议你再看看apache的errlog
3、建议你在各个可能出错的地方 or die "$!\n";
[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运行能取出数值呢?
DBD::Oracle有问题..重装吧..
上了一个小时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
问题解决