'install_driver(mysql) failed' using mod_perl add-on

Problems with the Windows version of XAMPP, questions, comments, and anything related.

'install_driver(mysql) failed' using mod_perl add-on

Postby daytonvh » 07. May 2009 21:28

Hi, I'm trying to get some Perl scripts running on my XAMPP server. I am running XAMPP 1.7.1 on Windows XP, and have installed xampp-win32-perl-addon-5.10.0-2.2.11-pl2-installer.exe

Specifically, I am having trouble with MySQL integration. In the point in my script where I reference DBI, the server throws this 500 error:

install_driver(mysql) failed: Can't load 'C:/xampp/perl/site/lib//auto/DBD/mysql/mysql.dll' for module DBD::mysql: load_file:The specified module could not be found at C:/xampp/perl/lib/DynaLoader.pm line 203. at (eval 60) line 3 Compilation failed in require at (eval 60) line 3. Perhaps a required shared library or dll isn't installed where expected at C:/xampp/htdocs/0perldev/Sessionmgr.pm line 46 ,

Note the double slash in the path to mysql.dll. The DLL is where it should be, I believe the double slash is a bug in some loader library. So far I'm pretty happy with the PHP behavior in XAMPP, but it's a little scary that Perl a) doesn't work fresh out of the box and b) seems to be buggy.

Any thoughts on how to fix this? Do I need to file a bug report?
daytonvh
 
Posts: 3
Joined: 07. May 2009 21:08

Re: 'install_driver(mysql) failed' using mod_perl add-on

Postby Sharley » 07. May 2009 23:45

The server 500 error you posted is it from the apache\logs\error.log file?

Did you run the setup_xampp.bat file as per the readme-addon-perl.txt file?

If you know that your scripts don't require mod_perl then don't select it when running the setup bat file - only select to use mod_perl if you know for sure your scripts require mod_perl.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: 'install_driver(mysql) failed' using mod_perl add-on

Postby daytonvh » 08. May 2009 05:51

The 500 error was as displayed by the browser, when I browsed to my Perl script's URL.

On a default XAMPP for Windows install, the server was serving files with the .pl extension as plain text. Not to be whiny or contentious, but after seeing how graciously XAMPP integrates Apache, PHP and MySQL fresh out of the box, it surprised me that Perl wasn't right there with them.

On an XAMPP installation without the Perl add-on package installed, the xampp_install.bat file just returns "Sorry but ... nothing to do!" After running the Perl add-on installer, it didn't occur to me that I might need to run any additional batch processes to get Perl working. My bad for not reading the readmes, I guess. :oops:

But even after running the batch file, browsing to my script returns a different 500 error:
install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted. Compilation failed in require at (eval 61) line 3. at C:/xampp/htdocs/0perldev/Sessionmgr.pm line 46 ,


Some more web searching prompted me to run this diagnostic:
c:\xampp\perl\bin\perl.exe -e "require DBD::MySQL"

which returned:
DBI object version 1.607 does not match $DBI::VERSION 1.604 at c:/xampp/perl/lib/DynaLoader.pm line 226.
BEGIN failed--compilation aborted at c:/xampp/perl/lib/DBI.pm line 263.
Compilation failed in require at c:/xampp/perl/site/lib/DBD/MySQL.pm line 7.
BEGIN failed--compilation aborted at c:/xampp/perl/site/lib/DBD/MySQL.pm line 7.

Compilation failed in require at -e line 1.

So there seems to be some version mismatch between what one library is expecting and what another library is offering. Again, this is all fresh, default configuration, nothing snuck in from CPAN, no hand-tweaked conf files or version strings.
daytonvh
 
Posts: 3
Joined: 07. May 2009 21:08

Re: 'install_driver(mysql) failed' using mod_perl add-on

Postby Sharley » 08. May 2009 09:36

No consolation but ever since the developer changed the Perl used in the addon from ActivePerl to what ever is used in these later versions there has been issues - some don't have problems but other people do.

I personally use ActivePerl and have never had any issues and I like the included Perl Package Manager.

There is a topic here that might give some idea but the final result was to downgrade to an older version which BTW includes the ActivePerl version of Perl in the Addon but this really should not be necessary:
viewtopic.php?f=16&t=33856

IMHO the developer changed from using ActivePerl because ActiveState changed the location of the ZIP file archive of ActivePerl that was used to create the Addon and was near impossible to locate (too hard basket).
Here is a link to the ActivePerl archive which is where the developer should look to return the addon to a more useful package - use the zip version for more placement control:
http://downloads.activestate.com/ActivePerl/Windows/

Take a look at these Google search results which may have some additional clues and ideas as to this problem - sometimes simply using the error message wrapped in quotes finds some interesting reading - this is what I used for the search keywords:
"DBI object version 1.607 does not match $DBI::VERSION 1.604"
Not many results but it may give ideas as to what keywords that can be used to good effect.

I also remember reading a post on these forums that had other fixes but at the moment I can't seem to find these posts from a search - I will keep looking and will post if I find them.

BTW you did change the shebang in all your .cgi scripts and your scripts have no coding problems?
On a default XAMPP for Windows install, the server was serving files with the .pl extension as plain text. Not to be whiny or contentious, but after seeing how graciously XAMPP integrates Apache, PHP and MySQL fresh out of the box, it surprised me that Perl wasn't right there with them.
Find this line in the httpd.conf file:
AddHandler cgi-script .cgi
and add .pl so it looks like this:
AddHandler cgi-script .cgi .pl
Save the file and restart Apache.
Test again by http://localhost/cgi-bin/printenv.pl which should return a text version of your Environment Variables.

Personally I don't use any of the XAMPP installer versions preferring the EXE (7zip) self extracting archive versions, IMHO more control over the install - try a fresh install using a different method other than the installer.

Check that you have the perl.conf file and the startup.pl file in the xampp\apache\conf\extra folder which should have been placed when you ran the setup_xampp.bat file.

Sorry I can't be more help at the moment but I will be interested in the final outcome that you decide to adopt.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: 'install_driver(mysql) failed' using mod_perl add-on

Postby daytonvh » 08. May 2009 15:27

Thanks so much for the info, Sharley! :D

The shebang lines in my own scripts did need fixing, but it wasn't a big deal.

printenv.pl runs fine, as do http://localhost/perl/perlinfo.pl and the Guest Book demo, so a lot of mod_perl is working fine.

I think I'm going to uninstall and re-install basic XAMPP, hand-edit httpd.conf to point to Perl, and if that configuration still doesn't make sense to me, I'll give ActivePerl a whirl.

On an unrelated note, I originally installed XAMPP as a platform for Drupal development, and I'm thrilled how easily they work together! 8)
daytonvh
 
Posts: 3
Joined: 07. May 2009 21:08

Re: 'install_driver(mysql) failed' using mod_perl add-on

Postby sneadm » 17. May 2009 21:24

I found that if I deleted the 'perl' directory under 'xampp' and then ran the zip extract for the perl addon, and run the setup.bat, this error goes away. I didn't have to reinstall all of xampp
sneadm
 
Posts: 1
Joined: 17. May 2009 21:18


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 45 guests