1

I am using Azure to host a site which uses Perl and MySql. I have placed all my Strawberry perl files in the bin folder. I connect to Perl by adding a handler to the Perl executable which is located on my web app in d:\home\site\wwwroot\bin\perl\bin\perl.exe.

I can run simple Perl programs ok. However when I try to run a Perl script which connects to a MySql database I get the following error:

install_driver(mysql) failed: Can't load 'D:/home/site/wwwroot/bin/perl/vendor/lib/auto/DBD/mysql/mysql.xs.dll' for module DBD::mysql: load_file:The specified module could not be found at D:/home/site/wwwroot/bin/perl/lib/DynaLoader.pm line 193.

However mysql.xs.dll exists in that location. I have also copied into the same folder as mysql.xs.dll the file libmysql_.dll which I read somewhere was a dependency of mysql.xs.dll.

The datasource I am trying to get to looks like this:

my $data_source = "DBI:mysql:$database:$hostname";

I am using the same code and binary files as handlers for Perl in my local IIS so I think all the files needed are there in my bin folder.

What else can I try?

Rob Sedgwick
  • 4,342
  • 6
  • 50
  • 87
  • According to the [documentation](http://p3rl.org/DBD::mysql), you should use `database=$database:host=$hostname` – choroba Dec 17 '15 at 21:46
  • I don't think that's the problem because I have used the same code on my local PC and in a LAMP environment and it worked. There error message indicates a problem with executable locations so I think that is what I need to solve. – Rob Sedgwick Dec 17 '15 at 21:49
  • How did you install the dlls? – choroba Dec 17 '15 at 21:53
  • I installed them on my Windows PC and copied the C:\Strawberry folder and everything beneath it on my PC to the bin folder at 'D:/home/site/wwwroot/bin' folder – Rob Sedgwick Dec 17 '15 at 21:55
  • 1
    Are you sure your PC has the same architecture and system as the target system? I'd rather install the software properly. – choroba Dec 17 '15 at 21:57
  • Because it's a web app I don't have access to the whole environment so you can't really install software. I can control whether it's 32-bit or 64-bit Windows on the web app. Plan B is to use a virtual machine instead where I can do that but I really wanted to get it working on a web app. – Rob Sedgwick Dec 17 '15 at 22:00
  • 1
    backslash or slash? That aside, you could provide modules with http://perlbrew.pl/. That is a much better approach to be somewhat independent of the system you want to deploy to. – bytepusher Dec 18 '15 at 23:09

0 Answers0