How to instal DBD::msql in XAMPP 5.6.3

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

How to instal DBD::msql in XAMPP 5.6.3

Postby SportsterPaul » 26. March 2015 17:27

I am running XAMPP 5.6.3 on a Windows 7 Pro laptop. It seems to work fine.

I am trying to instal Movable Type 5.2 Pro (no php, its all Perl), but its mt-check.cgi file reports there is no DBD::msql module installed. The details are:
Can't load 'C:/xampp/perl/vendor/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 190, <DATA> line 1662. at (eval 227) line 1.Compilation failed in require at (eval 227) line 1, <DATA> line 1662. BEGIN failed--compilation aborted at (eval 227) line 1, <DATA> line 1662.

The thing is, the XAMPP instal does have the file C:\xampp\perl\vendor\lib\auto\DBD\mysql\mysql.dll So unless I am in foreslash/\backslash Hell, I don't understand the problem. I have set the Movable Type shebangs to point at perl.exe and then I tried perl5.16.3.exe. Movable Type mt-check.cgi does report that DBI is installed and working [DBI (version >= 1.21) Your server has DBI installed (version 1.623).]

When I go to the xampp/perl/bin sub-directory and try to use ppm.bat it hangs with a missing libexpat-1.dll error. When I try to use cpan.bat, it goes and fetches the module but it can't install/compile/voodoo it since there is no Makefile.PL installed.

Two years ago I got an older version of XAMPP working with Movable Type on an XP box, but it was really ugly. I had installed both ActivePerl and Strawberry Perl on top of XAMPP and somehow managed to get this Frankenstein blend to run Movable Type. Now I am smarter and want to keep this as clean and basic of an XAMPP install as I can.

So how do I make Movable Type happy? Its been a full day of searching and messing around, and now I am pretty confident I don't really understand the problem, its more than just installing a module.
SportsterPaul
 
Posts: 3
Joined: 26. March 2015 16:44
Operating System: Win 7

Re: How to instal DBD::msql in XAMPP 5.6.3

Postby SportsterPaul » 26. March 2015 17:34

I should mention I did try to install the xampp-win32-perl-addon-5.10.0-2.2.11-pl2-installer.exe as mentioned in a Movable Type and XAMPP post that says "nobody tells you this" but that installer is for and older version of Apache, and refuses to install. I thought about doing a manual install, but it just seems too risky since it is for a down-rev Apache. Sorry for the double-post.
Last edited by SportsterPaul on 27. March 2015 00:04, edited 1 time in total.
SportsterPaul
 
Posts: 3
Joined: 26. March 2015 16:44
Operating System: Win 7

Re: How to instal DBD::msql in XAMPP 5.6.3

Postby SportsterPaul » 26. March 2015 23:01

OK, I think the simple answer is you can't install DBD::mysql in XAMPP since XAMPP does not appear to have a Perl compiler. I assume that people that don't have my problems are CS majors with 5 or 6 Perl compilers installed and all the Win .NET and all the other good programmer stuff.

I solved the problem by installing Strawberry Perl 5.20.2.1 (64bit). Yes, the 64 bit version. Since I have already wasted two days on this I figured to reach for the moon. At first there was no change in the mt-check.cgi file, still no DBD::mysql module was found. Then I went into the Strawberry Perl CPAN.bat file, and did an install DBD:mysql. It did a lot of chugging and seemed much happier than when I did this in the XAMPP CPAN.bat, where it failed since it could not find Makefile.PL. Still, mt-check.cgi still reported no DBD:mysql module. Then I noticed that some of the Strawberry Perl files, like relocation.txt had 8.3 file-names with a tilde, and if figured that I was back in 1987. So I stopped all the services and rebooted the computer. When it came back, restarted the service in the XAMPP control panel and then mt-check.cgi reported the DBD:mysql module was there. It may have been there all the time, and I should have done the reboot after installing Strawberry Perl, so maybe the whole CPAN.bat was silly. I did choose Strawberry Perl since the DBD::mysql install docs say SP has it bundled.

Oh, I did have to change all the shebangs in the Movable Type .cgi files to point at the perl.exe in the Strawberry Perl sub-directory. Since I have heard Movable Type does not like spaces in path names, I did install Strawberry Perl in C:\Strawberry. Other voodoo I tried that was probably irrelevant was using file explorer to set all the cgi and pl files to open with perl.exe.

So to sum up, installing Movable Type 5.2 Pro on XAMPP 5.6.3:
  1. Download xampp-win32-5.6.3-0-VC11-installer.exe and install in C:/xampp (default I think)
  2. Download strawberry-perl-5.20.2.1-64bit.msi and install in C:/Strawberry (not default)
  3. If transferring a working Movable Type install from a web server, use FileZilla to sftp the mt (They use MT5.0 or some foolishness, I renamed it) and mtstatic directories from your server.
  4. Move the mt directory to C:\xampp\cgi-bin
  5. Move the mt-static directory to C:\xampp\htdocs
  6. Change all the shebangs in the .cgi files in mt to point at the Strawberry Perl perl.exe, for me that was #!C:/Strawberry/perl/bin/perl.exe -w
  7. If not already, open the XAMPP control center (start>program files>XAMPP) and make sure both Apache and mysql are installed (left checkboxes) and started (those middle checkboxes).
  8. Type localhost in your browser address bar and enter. If you run no-script in Firefox, make sure to enable scripts for http://localhost at the bottom of the page. You may have to click on your language to get to the "real" XAMPP page.
  9. On the left panel, click Tools>phpMyAdmin
  10. Mess with that until you have figured out how to create a new database.
  11. Go back to http://localhost/xampp/ and click Welcome>security
  12. On that page click http://localhost/security/xamppsecurity.php
  13. Give your database a password, Movable Type will not run with an open database.
  14. Almost, hang in there. Edit the mt-config.cgi file with Notepad++ to have database have the same name as the one you just made, and to use the same password as the one you just set. Set CGIPath to /cgi-bin/mt/. Set StaticWebPath to /mt-static/. Set StaticFilePath to C:\xampp\htdocs\mt-static. And you know not to use the periods right, these are sentences, not code.
  15. Now go to your web host control panel and use their phpMyAdmin to export a zip file of the database for your Movable Type. Save it locally.
  16. In http://localhost/xampp/ go back to Tools>phpMyAdmin and select your shiny new database and click the import tab. Browse to the zip you just downloaded. Import the zip file.
  17. Reboot. Yes welcome to Perl, set your watch back 30 years.
  18. Start both the Apache and mySQL services in the XAMPP control panel. Remember, everything is a test, so you have to click on the left two buttons to "install" the services, then go to the middle of the dialog box and click "Start" for both services.
  19. You can verify that localhost in the browser address bar works. Then type in the browser address bar http://localhost/cgi-bin/mt/mt.cgi You should get the Movable Type logon screen. Since you brought the database down from your webserver, the same user and password should work on this local install.
  20. When it doesn't work, and it won't, change the mt-config.cgi file name to anything else, mt-config.cgi-misery is good. Then type http://localhost/cgi-bin/mt/mt-check.cgi in the browser address bar. Now you are back where I was, and you might see that DBD::mysql is not installed. I have assumed you are using a mysql database, so now maybe go into C:\Strawberry\perl\bin\cpan.bat and click it. In the command window type install DBD::mysql. It should chug for a long time, very verbose and seem generally happy, lots of OKs and such. When it is done, type quit.
  21. Reboot
  22. Start up XAMPP Apache and mysql
  23. Try http://localhost/cgi-bin/mt/mt-check.cgi in the browser bar again.
  24. If you have DBD::mysql installed now, you can change the file-name mt-config.cgi-misery back to mt-config.cgi. Then try http://localhost/cgi-bin/mt/mt.cgi good luck.
  25. If and when you did get this local Movable Type running, you need to go in the "Settings>General" of the website or top-level, and point the output files to where you want then to appear. So I left Website URL where it was, but changed Website Root to /Users/Paul/Docs/. The same deal, I don't want spaces in the path names, so I use Docs instead of My Documents. This of course is based on having XAMPP installed right under C:\.

If any single program, Win 7 Pro, XAMPP 5.6.3, Strawberry Perl 5.20.2.1 (64bit), Movable Type Pro 5.2.9 or even FileZilla and Notepad++ is different, none of this is likely to work and no one can help you. Note that you can use the regular ftp on Filezilla if you don't care about security. To use sftp I had to go up to Dreamhost and mess around to set some sftp setting in the domain I think it was. Suffer on soldier, suffer on.

The Step C, profit, part of this for me is that my Movable Type has really large scripts in the category page template so I get 504 Gateway Timeouts from DreamHost. They tell me things are taking to long so they kill the process. I thought about upgrading to a VPS, I sure can't afford a $200-a-month dedicated server, but then I still have a dog-slow Movable Type even if there are enough resources to not have the Gateway timeout.

Note you can point the Movable Type config file to still use the web database. There you have to go to your webhost, and for the user enable the IP address or the incoming address of the request. With the Brighthouse Networks here, that was a string with dashes between my IP address instead of periods and something like bbh.net concatenated to it.

It turns out my Movable Type is still dog slow when I point it to the web database, so I am stuck with running a local Movable Type with a local database. Not the worse thing in the world, but I have to backup or mirror the database somewhere. My big deal is that its not too hard to set up this local Movable Type to generate HTML pages with the proper URLS and such. I am not running any dynamic content, no comments, no trackbacks no external uses other than me. So I intend to just use this local Movable Type and the sftp the files up to Dreamhost, which will work fine slinging static HTML, even for 9 dollars a month.

[Update} The giant category template file creation that caused 504 Gateway timeout on the Dreamhost Movable Type install ran in 2:45 on my XP box with the old XAMPP and the kludge Perl I managed to get working. The box is a Athlon Thunderbird 4800+. The Lenovo Laptop (i7-3610QM CPU @ 2.3GHz) where I got this install running does the template files in 1:10, over twice as fast. It was worth the two days suffering to get this working.

And one cool-guy thing is you can run the local Movable Type from any computer on your LAN as long as the install box is powered up. Just type the IP address of the install box into the browser address bar and you should get the XAMPP page, then just figure out the paths to do the same mt.cgi file. For this you might want to go into your router and reserve the IP address so your install box will always have the same IP address.
SportsterPaul
 
Posts: 3
Joined: 26. March 2015 16:44
Operating System: Win 7

Re: How to instal DBD::msql in XAMPP 5.6.3

Postby ragortue » 31. May 2015 15:31

And one cool-guy thing is you can run the local Movable Type from any computer on your LAN as long as the install box is powered up. Just type the IP address of the install box into the browser address bar and you should get the XAMPP page, then just figure out the paths to do the same mt.cgi file. For this you might want to go into your router and reserve the IP address so your install box will always have the same IP address.


I think that one's doable. I'll try it myself. Image
ragortue
 
Posts: 10
Joined: 09. March 2015 16:21
Operating System: Centos 5.6

Re: How to instal DBD::msql in XAMPP 5.6.3

Postby perlnewbie » 25. December 2019 08:50

It looks like a nightmare! I'm having the same issue, can't connect to mysql, and I dont understand why isn't not working when mysql, perl and apache is shipped together. :-/
perlnewbie
 
Posts: 4
Joined: 28. September 2019 15:34
XAMPP version: 7.3.9
Operating System: Mac OS Mojave


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 109 guests