Apache无法在Mac OS X中加载DBI模块
我dbd:mysql通过安装cpan。我有以下简单的脚本: #!/usr/bin/perl -U use DBI; $ds = 'DBI:mysql:project:localhost'; $user = 'root'; $password = '123456'; $db = DBI->connect($ds, $user, $password) or die("Connection error\n"); $res = $db->prepare("SELECT * FROM root"); $res->execute(); while (my @row = $res->fetchrow_array()) { print $row[0]; } $res->finish(); $db->disconnect(); 当我从终端运行它时,一切都很好。但是,当我在浏览器中引用它时,会发生错误。Apache错误日志: [错误] [客户端127.0.0.1] install_driver(mysql)失败:无法为模块DBD加载'/Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle': mysql:dlopen(/Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle,1):库未加载:libmysqlclient.18.dylib [错误] [客户端127.0.0.1]引用自:/Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle [错误] [客户端127.0.0.1]原因:在/System/Library/Perl/5.12/darwin-thread-multi-2level/DynaLoader.pm第204行找不到图像。 我安装mod_perl并按照说明更改了httpd.conf: …