2

I'm developing a website for a university project, using WampServer and Perl.

Some details:

  • Using Windows Vista
  • Latest Strawberry Perl installed on C:\Strawberry\perl\bin\perl
  • Wamp 2.5 32 bit installed on C:\wamp

I followed all the Apache httpd.conf instruction to enable .cgi and .pl scripts.

The basic Perl script named printenv.pl is working:

#!perl

use strict;
use warnings;

print "Content-type: text/plain; charset=iso-8859-1\n\n";

foreach my $var ( sort( keys(%ENV) ) ) {

    my $val = $ENV{$var};

    $val =~ s|\n|\\n|g;
    $val =~ s|"|\\"|g;

    print "${var}=\"${val}\"\n";
}

Whenever I try to use my libraries on my scripts with use XML::LibXML the resulting website page gives 500 internal server error.

I have XML:LibXML up to date on CPAN, and I tried with a few other libraries too.

This is the Apache error log:

[Wed May 04 23:44:24.036757 2016] [authz_core:error] [pid 3892:tid 896] [client ::1:54937] AH01630: client denied by server configuration: C:/Apache24, referer: http://localhost/IMAS-master%20-%20Copia/cgi-bin/
[Wed May 04 23:44:24.038757 2016] [authz_core:error] [pid 3892:tid 912] [client ::1:54938] AH01630: client denied by server configuration: C:/Apache24, referer: http://localhost/IMAS-master%20-%20Copia/cgi-bin/
[Wed May 04 23:44:24.039757 2016] [authz_core:error] [pid 3892:tid 920] [client ::1:54939] AH01630: client denied by server configuration: C:/Apache24, referer: http://localhost/IMAS-master%20-%20Copia/cgi-bin/
[Wed May 04 23:44:24.040757 2016] [authz_core:error] [pid 3892:tid 904] [client ::1:54940] AH01630: client denied by server configuration: C:/Apache24, referer: http://localhost/IMAS-master%20-%20Copia/cgi-bin/
[Wed May 04 23:44:25.260757 2016] [cgi:error] [pid 3892:tid 904] [client ::1:54940] End of script output before headers: prova.pl, referer: http://localhost/IMAS-master%20-%20Copia/cgi-bin/
[Wed May 04 23:44:25.261757 2016] [cgi:error] [pid 3892:tid 904] [client ::1:54940] AH01215: Can't locate XML/LibXML.pm in @INC (@INC contains: /usr/lib/perl5/5.6.1/msys /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/msys /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl .) at C:/wamp/www/IMAS-master - Copia/cgi-bin/prova.pl line 3., referer: http://localhost/IMAS-master%20-%20Copia/cgi-bin/
[Wed May 04 23:44:25.261757 2016] [cgi:error] [pid 3892:tid 904] [client ::1:54940] AH01215: BEGIN failed--compilation aborted at C:/wamp/www/IMAS-master - Copia/cgi-bin/prova.pl line 3., referer: http://localhost/IMAS-master%20-%20Copia/cgi-bin/

I've looked for a solution for at least 10 hours now, but I really can't find any

Borodin
  • 126,100
  • 9
  • 70
  • 144
Skitinudo
  • 31
  • 4
  • Does your script work when a) you include `use XML:LibXML` in it and b) call it on the command line? – PerlDuck May 04 '16 at 22:27

1 Answers1

2

You seem to be looking at two different perl installations. You don't have XML::LibXML installed on the server

Borodin
  • 126,100
  • 9
  • 70
  • 144
  • I'd agree, but the OP said it's "up to date on CPAN". – PerlDuck May 04 '16 at 22:25
  • 1
    @PerlDog: *Something* may have `XML::LibXML` installed, but the server system doesn't – Borodin May 04 '16 at 22:53
  • 2
    Now I totally agree. From the apache log the server apparently is running perl 5.6.1 while the OP has _the latest strawberry_. Perhaps two different perl installations on the same machine? – PerlDuck May 04 '16 at 23:00
  • @PerlDog: I didn't spot that. Nice – Borodin May 04 '16 at 23:58
  • XML::LibXML worked on command line. I uninstalled strawberry perl, and now the command line says it can't open the file anymore. The command perl -v still works (this is perl v5.6.1 built for msys) and the scripts running in wamp (as long as i don't use libraries) work as before. Now i'm trying to find my "true" perl. Using perl -e "print $^X" it just says "perl". – Skitinudo May 05 '16 at 10:27
  • 2
    I uninstalled the msys stuff (i can't rememeber why i had it, probably for c compilator) and reinstalled strawberry perl. Now everything works, and i don't get anymore errors with libraries. Thanks! – Skitinudo May 05 '16 at 10:49