ringoです。
SSIのカウンタの作成が目的で#簡単な実験中#。
DBIを使えばエラーが出ます。
####################################
# 自分の環境
####################################
Vine Linux 2.6 (1週間前にインストール)
perl 5.8.1 ソース(stable.tar.gz)からのインストール
DBI,DBD::Pgのインストール方法
cpan>install DBI,
cpan>install DBD::Pg
postgresql-7.2.3-0vl1
postgresql-server-7.2.3-0vl1
user1=# select * from test;
id
----
4
(1 row)
###############################################
# dbi.plのソース
###############################################
#!/usr/local/bin/perl -w
use strict;
use DBI;
#/////////////////////////////////////////////#
# Part 1
#/////////////////////////////////////////////#
my $dbh = DBI->connect("dbi:Pg:dbname=test","user1");
my $sth = $dbh->prepare("select * from test");
$sth->execute;
my @data;
while ( @data = $sth->fetchrow_array){
print join "\t",@data,"\n";
}
$dbh->disconnect;
#/////////////////////////////////////////////#
# Part 2
#/////////////////////////////////////////////#
print "It is fine today.";
###############################################
# dbi.plのソースここまで
###############################################
> perl -cw dbi.pl
dbi.pl syntax OK
>./dbi.pl
It is fine today.
###############################################
# 問題点
###############################################
ここで、index.shtml内に以下を記入
<body>
<!--#exec cmd="./dbi.pl"-->
</body>
つまり、SSIで動作確認をします。
DBIを使えば、エラーがでます。
[an error occurred while processing this directive]
DBIを使わない場合(Part1をコメント)は、エラーがでま
せん。
4 It is fine today.と表示される。
FreeBSD 4.8 (/stand/sysinstall)正常に動作します。
Vine 2.6で、エラーが発生します。
原因がわかる方はお願いします。
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/