To administer your WestHost account, please enter your
Domain Name or Server Manager Username.

WestHost: Professional Website Hosting Company








Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    Default Installing Perl GD module with CPAN

    Per the excellent section: Installing Perl modules with CPAN in this forum section I have successfully installed several Perl modules that I needed (AppConfig, DBI, Date::Format, Mail::Mailer). I put them in a directory called perl5add (/usr/local/perl5add) and put an export statement in my .bashrc file for it (export PERL5LIB=/usr/local/perl5add/lib). However, I need to install the GD Perl module as well but I run into errors when running perl -MCPAN -e 'install "GD"'.

    The questionable output I see is after the tarball is downloaded and after the CPAN.pm: Going to build L/LD/LDS/GD-2.32.tar.gz message. I get this series of lines -
    If you experience compile problems, please check the @INC, @LIBPATH and @LIBS
    arrays defined in Makefile.PL and manually adjust, if necessary.

    Checking if your kit is complete...
    Looks good
    Unrecognized argument in LIBS ignored: '/usr/local/lib/libiconv.so'
    Unrecognized argument in LIBS ignored: '-Wl,-rpath'
    Unrecognized argument in LIBS ignored: '-Wl,/usr/local/lib'
    Writing Makefile for GD

    ...then a bunch of output lines that look okay and finally...
    /bin/make -- OK

    So I'm not sure if the Unrecognized argument messages are the issue but the next section of the install is where the installation indicates a fail -

    Running make test
    PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
    t/GD..........Can't load './blib/arch/auto/GD/GD.so' for module GD: /usr/local/lib/libgd.so.2: undefined symbol: FT_Activate_Size at /usr/local/perl/lib/5.8.7/i686-linux/DynaLoader.pm line 230.
    at t/GD.t line 14
    Compilation failed in require at t/GD.t line 14.
    BEGIN failed--compilation aborted at t/GD.t line 14.
    t/GD..........dubious
    Test returned status 2 (wstat 512, 0x200)
    DIED. FAILED tests 1-12
    Failed 12/12 tests, 0.00% okay
    t/Polyline....Can't load '/usr/home/[myWestHostAccount]//.cpan/build/GD-2.32/blib/arch/auto/GD/GD.so' for module GD: /usr/local/lib/libgd.so.2: undefined symbol: FT_Activate_Size at /usr/local/perl/lib/5.8.7/i686-linux/DynaLoader.pm line 230.
    at /usr/home/[myWestHostAccount]//.cpan/build/GD-2.32/blib/lib/GD/Polyline.pm line 45
    Compilation failed in require at /usr/home/[myWestHostAccount]//.cpan/build/GD-2.32/blib/lib/GD/Polyline.pm line 45.
    BEGIN failed--compilation aborted at /usr/home/[myWestHostAccount]/.cpan/build/GD-2.32/blib/lib/GD/Polyline.pm line 45.
    Compilation failed in require at t/Polyline.t line 10.
    BEGIN failed--compilation aborted at t/Polyline.t line 10.
    t/Polyline....dubious
    Test returned status 2 (wstat 512, 0x200)
    DIED. FAILED test 1
    Failed 1/1 tests, 0.00% okay
    Failed Test Stat Wstat Total Fail Failed List of Failed
    -------------------------------------------------------------------------------
    t/GD.t 2 512 12 23 191.67% 1-12
    t/Polyline.t 2 512 1 2 200.00% 1
    Failed 2/2 test scripts, 0.00% okay. 13/13 subtests failed, 0.00% okay.
    make: *** [test_dynamic] Error 2
    /bin/make test -- NOT OK
    Running make install
    make test had returned bad status, won't install without force


    I'm not sure if this is a version mismatch between the Perl GD-2.32 module and the version of Perl (v5.8.7) running on the server or some other problem.
    Is there a way to specify a different Perl module version in the perl -MCPAN -e 'install "<modulename>"' command?

  2. #2
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    It looks like you have an old version of gd installed at:
    /usr/local/lib/libgd.so.2
    and that is failing the test.

    From the output, it seems that the GD library is being built ok, but when the test system runs it is picking up the older library. Maybe you can remove or rename the old one and run the test again?

  3. #3
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    Default

    Thanks Jalal. It looks like if I want to update my Perl GD library I'll have to see if WestHost can do it as root.

    root 948968 Jan 5 2005 libgd.a
    root 750 Jan 5 2005 libgd.la
    root 14 May 19 2005 libgd.so -> libgd.so.2.0.0
    root 14 May 19 2005 libgd.so.2 -> libgd.so.2.0.0
    root 504954 Jan 5 2005 libgd.so.2.0.0

    WestHost is the root owner on my VPS.

    The reason I am trying to upgrade the Perl GD library is because I am trying to install and configure Bugzilla 2.20. When Bugzilla runs a Perl library compatibility check it flags the GD lib as one that isn't correct. This is the message the Perl check writes out -

    The following Perl modules are optional:
    Checking for GD (v1.20) not found
    Checking for Chart::Base (v1.0) not found
    Checking for XML::Parser (any) ok: found v2.34
    Checking for GD::Graph (any) not found
    Checking for GD::Text::Align (any) not found

    The Perl library requirements are a little confusing because while it appears that GD 1.20 is required the resolution is to run perl -MCPAN -e 'install "GD"' which always results in the attempt to upgrade the Perl GD lib to 2.32. I am going to submit that question to the Bugzilla forum.

    In the meantime, according to Bugzilla installation instructions, the GD library is an optional item so I am going to continue without it (means I won't have report graphing capabilities I think).

    If I get the Perl GD library issue resolved I will post an update. Thanks again for your help and I would like to also thank you for your involvement in the instructions on setting up CVS and xinetd on a WestHost VPS. That was great. I have been running CVS now for several months without any problems.

  4. #4
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    Default

    I think that I almost have bugzilla running but there appears to be an issue with the Perl modules I installed earlier not being found when Apache processes a request to the bugzilla web directory where the perl scripts using the modules are located.

    Earlier I successfully ran perl -MCPAN -e ’install "Date::Format"’ and it installed into my /usr/local/perl5add directory. After doing that I can run the Bugzilla checksetup.pl script and get a pass indication that the Date::Format Perl module can be found.

    After running other Bugzilla installation check routines it appears that everything is in place and Bugzilla should run. However, when I try to access the Bugzilla home directory on my website (http://<myWesthostSite>/bugzilla) I get a 500 Internal Server Error message. The Apache error log contains this -
    Can't locate Date/Format.pm in @INC (@INC contains: . /usr/local/perl/lib/5.8.7/i686-linux /usr/local/perl/lib/5.8.7 /usr/local/perl/lib/site_perl/5.8.7/i686-linux /usr/local/perl/lib/site_perl/5.8.7 /usr/local/perl/lib/site_perl) at Bugzilla/Error.pm line 32.
    BEGIN failed--compilation aborted at Bugzilla/Error.pm line 32.
    Compilation failed in require at Bugzilla/Util.pm line 45.
    BEGIN failed--compilation aborted at Bugzilla/Util.pm line 45.
    Compilation failed in require at CGI.pl line 43.
    BEGIN failed--compilation aborted at CGI.pl line 43.
    Compilation failed in require at /var/www/html/bugzilla/index.cgi line 33.
    [Sun Mar 26 21:13:11 2006] [error] [client 12.171.188.29] Premature end of script headers: /var/www/html/bugzilla/index.cgi

    So it would appear that the location of my added Perl module libraries (in /usr/local/perl5add/lib) are not being found when Apache is processing the request. Am I missing an entry in the httpd.conf file that needs to define where the added Perl module libraries are?

  5. #5
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    You have the locations of the new libraries listed in /.bashrc but this file is only read by a login shell. Programs such as Apache won't read that file and won't find the libraries.

    Possibly this may help:
    http://perl.apache.org/docs/1.0/guid...C_and_mod_perl

    HTH

  6. #6
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    Default

    Cool, that looks promising. I'll have to finish working on this after some sleep. My initial attempt didn't work though. I tried adding this to my httpd.conf file -
    SetEnv PERL5LIB "/usr/local/perl5add/lib"
    It didn't fix the problem.

  7. #7
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    Default

    I'm stuck right now trying to get my added Perl modules into the Apache environment (when Apache starts).

    After doing Google searches I found that some people suggessted the SetEnv in httpd.conf worked while other people suggested using PerlSetEnv. Since using SetEnv PERL5LIB "/usr/local/perl5add/lib" didn't work for me I tried the second suggestion. In my httpd.conf I have this -

    <IfModule mod_perl.c>
    Alias /mod-perl /var/www/cgi-bin/mod-perl
    <Location /mod-perl>
    SetHandler perl-script
    PerlHandler Apache::Registry
    PerlSetEnv PERL5LIB "/usr/local/perl5add/lib"
    Options +ExecCGI
    </Location>
    </IfModule>


    /usr/local/perl5add/lib is where I had CPAN build and place the libraries of my additional Perl modules.
    Unfortunately the PerlSetEnv setting didn't help. My Perl scripts that try to run when accessing them from the web don't know where necessary Perl modules are.

    In a shell, though, the exported PERL5LIB works fine and I get this when I run perl -V

    %ENV:
    PERL5LIB="/usr/local/perl5add/lib"
    @INC:
    /usr/local/perl5add/lib/i686-linux
    /usr/local/perl5add/lib
    /usr/local/perl/lib/5.8.7/i686-linux
    /usr/local/perl/lib/5.8.7
    /usr/local/perl/lib/site_perl/5.8.7/i686-linux
    /usr/local/perl/lib/site_perl/5.8.7
    /usr/local/perl/lib/site_perl
    .

  8. #8
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    Just a guess, but maybe PerlSetEnv shouldn't be inside a Location directive, otherwise it only applies to that location.
    And remember to restart apache after changing httpd.conf (or at least, using '/etc/rc.d/init.d/httpd graceful')

  9. #9
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    Default

    Originally I tried the PerlSetEnv PERL5LIB "/usr/local/perl5add" after the SetEnv PERL5LIB "/usr/local/perl5add" didn't work. I placed those near the end of the Apache httpd.conf file (not at the same time of course).

    While the SetEnv just didn't work, the PerlSetEnv caused my Apache server to not run. After that I found an example where the PerlSetEnv was used in the <Location /mod-perl> section. It didn't work but Apache still did. From the Apache log though I can see that the Perl @INC variable doesn't include my perl5lib values -

    (@INC contains: . /usr/local/perl/lib/5.8.7/i686-linux /usr/local/perl/lib/5.8.7 /usr/local/perl/lib/site_perl/5.8.7/i686-linux /usr/local/perl/lib/site_perl/5.8.7 /usr/local/perl/lib/site_perl)

    I read something where the Perl taint setting could be on and preventing the additional library modules to be included but I don't see anything in the httpd.conf file to support that. I don't want to go in and insert use commands in all of the perl scripts. There has to be a way to add them to the Apache environment.

  10. #10
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    Default

    Update - It appears that I may have to roll back my Perl 5.8.7 version to Perl 5.6 in order to install Mod Perl and have Apache use my additional Perl modules. From what I have found searching the web, the PerlSetEnv entry I need to use in the Apache httpd.conf file requires Mod Perl. I thought that I had Mod Perl with my Perl 5.8.7 installation but now I realize that I don't. The Mod Perl installation on WestHost is version 1.2.6. It can be installed if I have Perl 5.6 installed but not Perl 5.8.7.

    The thing that is confusing to me is this entry in my current httpd.conf file -

    <IfModule mod_perl.c>
    Alias /mod-perl /var/www/cgi-bin/mod-perl
    <Location /mod-perl>
    SetHandler perl-script
    PerlHandler Apache::Registry
    Options +ExecCGI
    </Location>
    </IfModule>


    I can add PerlSetEnv PERL5LIB "/myPerlModulePath" here and my Apache will start up. If I move the PerlSetEnv command to somewhere else in my httpd.conf then Apache won't start and complains that PerlSetEnv is not recognized. Does that mean that the entries in this module are skipped over during the Apache startup? Isn't this httpd.conf definition what tells Apache where to send Perl scripts?

    If I don't have Mod Perl installed in Apache isn't there a way to define additional Perl library paths?

Similar Threads

  1. Installing Bugzilla on a WestHost VPS
    By sonavor in forum CGI Scripts / Perl
    Replies: 0
    Last Post: 03-28-2006, 11:43 PM
  2. Installing Perl modules with CPAN
    By jalal in forum CGI Scripts / Perl
    Replies: 19
    Last Post: 11-03-2005, 10:02 AM
  3. Bugzilla install. Running into Perl module issues
    By codehooligans in forum CGI Scripts / Perl
    Replies: 1
    Last Post: 09-11-2005, 02:55 PM
  4. problem installing a perl module
    By drgandy in forum CGI Scripts / Perl
    Replies: 1
    Last Post: 01-26-2005, 06:52 AM
  5. Perl Module Problems
    By TFS in forum CGI Scripts / Perl
    Replies: 5
    Last Post: 01-22-2005, 01:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •