Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Unable to get cpan module DBI to work with apache and mod_perl

I was able to dig around and finally found the mod_perl lib, added that to the apache config and was able to start apache successfully.

I then updated my cpan modules for Perl 5.8.8 (ended up removing the 5.8.6 library as I had warnings of possible conflicts... putting it back didn't seem to make any difference in this issue).

So I started putting together my config for my web applications and I cannot for the life of me get it booted with using DBI successfully.

I keep getting this error:
[Mon Oct 29 12:04:39 2007] [error] Can't load '/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI/DBI.bundle' for module DBI: dlopen(/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI/DBI.bundle, 1): no suitable image found. Did find:\n\t/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI/DBI.bundle: no matching architecture in universal wrapper at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/DynaLoader.pm line 230.\n at /Library/Perl/5.8.8/darwin-thread-multi-2level/DBI.pm line 266\nBEGIN failed--compilation aborted at /Library/Perl/5.8.8/darwin-thread-multi-2level/DBI.pm line 266.\nCompilation failed in require at /Library/WebServer/Documents/timewarner acm/lib/ACMhandler.pm line 7.\nBEGIN failed--compilation aborted at /Library/WebServer/Documents/timewarner acm/lib/ACMhandler.pm line 7.\nCompilation failed in require at (eval 3) line 3.\n

To note:
1. I have successfully loaded and used the DBI module with a regular perl script
2. I have installed, uninstalled, made by hand, etc, etc the DBI module with no errors.

Any ideas? I've used previous versions of Mac OS X successfully for my web development, but I cannot get around this. Any ideas? Thoughts?

MacBook Pro 15", Mac OS X (10.5)

Posted on Oct 30, 2007 10:27 AM

Reply
7 replies

Nov 1, 2007 11:18 AM in response to rwhitney

Solution is this:
You need to enable -arch x86_64 and (maybe) -arch ppc64
in the DBI build.
You'll need to do this by editing the Makefile after you run `perl Makefile.PL`
(if anyone know another way, I'd love to know too, as I find myself recompiling alot perl modules by hand now, which is a bummer)

It appears that now leopard is fully universal, as in: it can boot any mac. Because of this all apache and it's modules are compiled universal. For some reason this is causing the DynaLoader to fail loading modules that are also non-universal. By recompiling your module as universal, it will then load inside mod_perl.

I'm still looking for a way to either disable this requirement or enable CPAN to build for all architectures. It currently only builds for -arch i386 and -arch ppc.

Jan 20, 2008 3:56 PM in response to rwhitney

I know I'm late to this thread, but I just recently discovered the same problem and have not been able to get CPAN to compile universal binaries with the ARCHFLAGS variable set.

It appears the problem is that while Apache2 was compiled as a universal binary supporting 64 bit architectures, perl itself was built for 32 bit only (perhaps with good reason), and so there is this basic incompatibility between the two.

I gave up and rebuilt Apache from scratch with mod_perl statically compiled inside. My request is just that in a future update, Apple make some effort to see that the two provided binaries work together. Would be appreciated.

Unable to get cpan module DBI to work with apache and mod_perl

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.