Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't load 'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML

I have downloaded strawberry PERL and writing one application with CGI Perl Apache on Winxp sp3). One of the libraries (written by someone else) which I using uses XML::LibXML. When i load the page it gives Internal Server Error. From Apache error log i can see this error:
Can't load 'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML: load_file:The specified module could not be found at C:/strawberry/perl/lib/DynaLoader.pm line 190.
C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll exists with all permissions. Also this library works properly on Linux. My application also works fine if I remove all code that needs LibXML.
Can anyone tell me when can be possible issue here.

like image 860
Jitender Mann Avatar asked Jul 13 '12 09:07

Jitender Mann


2 Answers

If you peek into the source for DynaLoader you'll find

Many dynamic extension loading problems will appear to come from this section of code: XYZ failed at line 123 of DynaLoader.pm. Often these errors are actually occurring in the initialisation C code of the extension XS file. Perl reports the error as being in this perl code simply because this was the last perl code it executed.

You should have also gotten (but may not have noticed) the following dialog, which provides a more accurate error message:

libxml2.dll is missing

The problem isn't that perl can't find LibXML.dll; it's that LibXML.dll can't find the real libxml. (The former is just a wrapper that provides Perl bindings for the latter.) To fix that you need to ensure that Strawberry Perl's c\bin folder is in your PATH. In your case, that would be C:\strawberry\c\bin.

like image 51
Michael Carman Avatar answered Sep 17 '22 17:09

Michael Carman


You might have to check the environment variable settings in the windows, make sure that the installation path of the module is present in the PATH variable. The reason it works in linux is that make files usually set the environment variables for you in linux in windows it may not have set properly. For eg; go to Control Panel\System and Security\System click change settings then advanced tab in user variable section see if there is a variable called perl5lib. if not create an new perl5lib variable and add the path of your library ( usuall C:\Perl\site\lib but may be different in your case)

like image 37
dhanvantharim Avatar answered Sep 20 '22 17:09

dhanvantharim