免费注册 查看新帖 |

Chinaunix

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

含DBI使用的CGI的WEB浏览有问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-02-06 19:00 |只看该作者 |倒序浏览
#!/usr/bin/perl
use CGI qw(:standard escape);
use DBI qw(:sql_types);

$CGI:OST_MAX=10000;
$CGI:ISABLE_UPLOADS = 1;



print "Content-type:text/html\n\n";


print "<html><head><title>Have a try</title></head><body>";
print "<table><tr><td>footprint1</td></tr></table>\n\n";

my $db_dbh = DBI->connect ("dbi:Oracle:test","scott","tiger",);

my $db_sth = $db_dbh->prepare("select id,name,title,phone from test";

$db_sth->execute();

my($id,$name,$title,$phone);
$db_sth->bind_columns(undef,\$id,\$name,\$title,\$phone);

while( $db_sth->fetch() ) {
        print "<table><tr>";
        print "<td>Object: $id, $name, $title,$phone</td>\n";
        print "</tr></table>";

}
print "</body></html>\n";
$db_sth->finish();
$db_dbh->disconnect;


在终端执行是好的, 但是在APACHE中只执行到 my $db_dbh=DBI....之前

多谢!!!

[ 本帖最后由 easytolab 于 2006-2-6 21:10 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-02-06 19:45 |只看该作者

error messages

install_driver(Oracle) failed: Can't load '/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl: fatal: /export/home/oracle/ora10/product/lib32/libclntsh.so.10.1: Permission denied at /usr/local/lib/perl5/5.6.1/sun4-solaris/DynaLoader.pm line 206.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./getdate.pl line 16

论坛徽章:
0
3 [报告]
发表于 2006-02-06 20:02 |只看该作者
似乎是nobody用户的问题,   我用非root系统用户来执行也是好的, 如何解决这个问题呢? 有高手请详细说明一下, 初学,不懂的地方很多, 请多帮忙

论坛徽章:
0
4 [报告]
发表于 2006-02-06 21:27 |只看该作者
最后将apache运行的用户改为一个有权限的用户就可以了, 但是有其他的方法没有呢? 欢迎指教!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP