Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Error Message - PL_perl_destruct_level at /usr/lib64/perl5/DynaLoader.pm

by NorCal12 (Novice)
on Apr 28, 2016 at 04:45 UTC ( [id://1161726]=perlquestion: print w/replies, xml ) Need Help??

NorCal12 has asked for the wisdom of the Perl Monks concerning the following question:

I am new to this forum and certainly not a Perl expert.

I have a website that is an auction for the commercial fishing industry. It has been up and running since 2011. It is currently located on a shared hosting site and I am in the process of moving it to a VPS site on another company's server. I have move all the files and database to the new location and I have been testing everything before I have the DNS pointed to the new location. For the most part everything looks good. I have an archive section, where a user can look at tables of past sales. These are generated from data stored in a mysql database. The display of past sales works fine.

However, when I test a new sale I get an error when that sale is being inserted into the database. For speed in testing I have been using a "buy-it-now" feature rather than have to wait for an auction to end.

The code begins as below:

#!/usr/bin/perlml BEGIN { my $base_module_dir = (-d '/home/jeffer36/perl' ? '/home/jeffer36/per +l' : ( getpwuid($>) )[7] . '/perl/'); unshift @INC, map { $base_module_dir . $_ } @INC; unshift @INC, '/home/jeffer36/perl5/lib/perl5','/home/jeffer36/perl5/ +lib/perl5/x86_64-linux','/home/jeffer36/perl5/lib/perl5/x86_64-linux/ +Bundle'; } use POSIX qw(strftime); use File::Copy; use strict; use CGI; use CGI::Session; use CGI::Carp qw(fatalsToBrowser); use File::CounterFile; use Data::Dumper; use DBI; #use DBD::mysql;

When the sale is being inserted into the database this is the error message:

install_driver(mysql) failed: Can't load '/home/jeffer36/perl5/lib/perl5/x86_64-linux/auto/DBD/mysql/mysql.so' for module DBD::mysql: /home/jeffer36/perl5/lib/perl5/x86_64-linux/auto/DBD/mysql/mysql.so: undefined symbol: PL_perl_destruct_level at /usr/lib64/perl5/DynaLoader.pm line 200, <BUYERFILE> line 88. at (eval 16) line 3 Compilation failed in require at (eval 16) line 3, <BUYERFILE> line 88. Perhaps a required shared library or dll isn't installed where expected at ../auction/buyit.pl line 284</P.

Line 284 in buyit.pl is:

my $dbh = DBI->connect("DBI:mysql:$db:$server", $userid, $passwd);

I have search the web for information on this error message and have come up empty. Does anyone have suggestions on how to correct the problem?

Replies are listed 'Best First'.
Re: Error Message - PL_perl_destruct_level at /usr/lib64/perl5/DynaLoader.pm
by syphilis (Archbishop) on Apr 28, 2016 at 05:14 UTC
    The installed version of DBD::mysql was built for a version of perl that defined the symbol PL_perl_destruct_level, but now you're running it on a perl that doesn't define that symbol.
    Try building and installing DBD::mysql from source.

    Cheers,
    Rob

      Rob, thanks for the reply. On the server, I have gone to cPanel and installed DBD::mysql. Is this what you were suggesting? If so that has been done.

      If you are suggesting something different, can you elaborate or point me in the direction for information on how to accomplish what it is that you are suggesting

      Pete

        Is this what you were suggesting?

        I don't think so - though I'm not entirely sure what installing via cPanel actually does.
        I assume it just installs a pre-compiled DBD::mysql for you - and if that's the case you need to file a bug report with whoever is responsible for providing that pre-compiled DBD::mysql.
        It is simply not compatible with the perl that you are running.

        I suppose another option might be to use a perl that is compatible with that build of DBD::mysql (if such a perl is available to you).

        Cheers,
        Rob
Re: Error Message - PL_perl_destruct_level at /usr/lib64/perl5/DynaLoader.pm
by Laurent_R (Canon) on Apr 28, 2016 at 06:29 UTC

      Indeed the topic has been discussed elsewhere, but please note that there has been no resolution there either. I am seeking advice on how to correct the problem.

      The code worked fine on server #1. Move the code to server#2 and it does not work. Server #2 was set up by tech support with Perl installed. Server #2 has Control Panel access, where various modules of Perl can be installed. I installed the DBD::mysql modules via the Control Panel. If this error is suggesting that there is some incompatibility between the installed version of Perl and the install DBD::mysql module, I would like to know. I can talk to tech support about this. Right now, their position is that my code is at fault.

      If there is a way to install a compatible version of DBD::mysql, then I need some guidance on how to do this.

      Pete
        There is no problem with posting your request here after having posted somewhere else, especially if your issue was not solved there.

        It is still better to provide information about the fact that it has been discussed somewhere else and to provide links, because the two threads in question provide quite a bit of background and this may help avoiding the same questions again.

        If this error is suggesting that there is some incompatibility between the installed version of Perl and the install DBD::mysql module, I would like to know. I can talk to tech support about this.

        Yes, the error message is telling you that the installed DBD::mysql module is incompatible with the installed Perl.

        The shared library, DBD/mysql/mysql.so was not built with the same compile options as the Perl executable running your program.

        FYI, DBD/mysql/mysql.so is an extension to Perl that allows Perl that enables Perl to use the MySQL client library. Many applications use extensions or plug-ins. In all cases, the extension/plug-in must be compiled properly to be usable with the application. Perl is no different.

        I am thinking that your new hosting provider installed DBD::mysql using a different Perl (probably the "system Perl") than the one they allow to run user programs. Likely the control panel you used to "install" DBD::mysql actually just created a symbolic link to the already installed DBD::mysql, resulting in the compatibility issue.

        If there is a way to install a compatible version of DBD::mysql, then I need some guidance on how to do this.

        Maybe, but will be tricky. If the new hosting service can't or won't resolve the incompatibility, you should consider a different hosting service

        Since it sounds like you have no way to directly run the CPAN tool in your virtual host, you will need to duplicate the Perl installation on your own machine.

        Also, you will need to be able to upload not only your Perl programs, but compiled library files as well. And you will need to be able to create the required subdirectories so that Perl can find the files.

        Config can be used in a Perl program you run in the virtual host to tell you about the Perl installation.

        Using that information, duplicate as best as possible that Perl installation on your own machine. Then you can install DBD::mysql on that. Then you can upload the installed pm and so files to the virtual server.

Re: Error Message - PL_perl_destruct_level at /usr/lib64/perl5/DynaLoader.pm
by Mr. Muskrat (Canon) on Apr 28, 2016 at 14:08 UTC

    Summary of your set up and problem as described

    1. You are using /usr/bin/perlml as your Perl executable (whatever version that is).
    2. You installed DBD::mysql via cPanel which may or may not use /usr/bin/perlml.
    3. You have the Perl modules for the version of Perl you used on the old server in subdirectories of /home/jeffer36.
    4. You presumably have your own Perl modules somewhere in /home/jeffer36 as well.
    5. You have code (such as the above snippet) that tell the new Perl executable to use the old and incompatible modules.

    Break the chains that are holding you back! (How to fix it)

    1. Remove the @INC entries for the old and incompatible Perl modules.
    2. Determine if cPanel installs Perl modules for use by /usr/bin/perlml.
    3. If needed, update your script to use the version of Perl that cPanel updates.
    4. Try to run the script.
    5. Install missing modules.
    6. Repeat steps 4 and 5 until it executes successfully.

      Mr. Muskrat, thank you for your clear suggestions. I wish to clarify somethings that may have been misunderstood.

      In your summary, item #1, I am using /usr/bin/perlml as my executable. This is because when I go to the Perl Module section of cPanel it states: "Using Your Perl Module(s) Your Perl script needs to know how to find the modules in your path. You can do this by adding one of the two choices below to the top of your script: #!/usr/bin/perl use cPanelUserConfig; or #!/usr/bin/perlml".

      In your summary, item #2, my assumption is that since the cPanel instructed me to use "#!/usr/bin/perlml", that the installation of DBD::mysql via the cPanel would be using "#!/usr/bin/perlml".

      In your summary, item #3, I did not transfer any of the perl modules from the old server to the new. I only moved the webpage scripts and mysql database data. I am relying upon the install version of perl on the new server and all new installations of modules.

      As for the various versions. Again from cPanel, Perl is version 5.10.1 and DBD::mysql is vesion 4.033.

      .

        This is because when I go to the Perl Module section of cPanel it states: "Using Your Perl Module(s) Your Perl script needs to know how to find the modules in your path. You can do this by adding one of the two choices below to the top of your script: #!/usr/bin/perl use cPanelUserConfig; or #!/usr/bin/perlml".

        In your summary, item #3, I did not transfer any of the perl modules from the old server to the new. I only moved the webpage scripts and mysql database data. I am relying upon the install version of perl on the new server and all new installations of modules.

        Okay, fair enough but your responses prompt more questions.

        If cPanel installs modules where /usr/bin/perlml can find them, why did you modifying @INC in the BEGIN block? What is actually stored in the perl and perl5 subdirectory structures in /home/jeffer36?

        my assumption is that since the cPanel instructed me to use "#!/usr/bin/perlml", that the installation of DBD::mysql via the cPanel would be sing "#!/usr/bin/perlml".

        Seems to me that their advice is to use either /usr/bin/perl or /usr/bin/perlml. I would suggest giving /usr/bin/perl a try (if you haven't already).

        Cheers,
        Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1161726]
Front-paged by stevieb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-26 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found