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

Greetings Perl Monks.

I'm an occasional, though long-time Perl coder.

On a CentOS shared hosting setup, I had a load of perl scripts reading and writing successfully to a Maria database using DBI.

The hosting company, for good reasons, migrated the account to another server running Almalinux, and the above scripts broke. For a long time the hosting company blamed coding errors, which were apparently spontaneously created without human intervention when the account was migrated.

I've spent quite a bit of time investigating and the core issue is that the following error is given (by redirecting STDERR to a text file), together with a 500 server error to browser, by the pared down code below (yes, the original code did have use strict, warnings, diagnostics, redirect to STDERR, db write, disconnect, and attempted to write to browser, among other features).

usr/bin/perl: symbol lookup error: /home/username/perl5/lib/perl5/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so: undefined symbol: Perl_xs_version_bootcheck

#!/usr/bin/perl use cPanelUserConfig; use DBI; our $dbpath = "DBI:mysql:valid_servername:localhost"; our $dbuser = "validUsername"; our $dbpass = "validPassword"; my $result = pushdata(); sub pushdata { my $dbh = DBI->connect($dbpath,$dbuser,$dbpass); 1; }
See also this thread:

https://forum.directadmin.com/threads/error-on-spamassassin-install.67667/

On talking again with the hosting company, they've made further disclosures, stating that they are running Perl v5.26.3 where 'perl scripts and modules are not compatible or wont work'.

Can the Monks share any enlightenment on whether backward compatibility in Perl is now lost and the format of DBI calls needs to change, or whether perhaps I should seek a different hosting company, among other possible solutions? Thanks in advance.

Replies are listed 'Best First'.
Re: Almalinux throwing Perl_xs_version_bootcheck undefined error
by Corion (Patriarch) on Aug 31, 2023 at 11:25 UTC

    When the Perl major version is changed, all modules need to be reinstalled. If for example the old Perl version was 5.24 and now is 5.26, all Perl modules under /home/username/perl5 need to be reinstalled.

Re: Almalinux throwing Perl_xs_version_bootcheck undefined error
by marto (Cardinal) on Aug 31, 2023 at 11:23 UTC

      Thanks for the quick replies. After migration many modules were gone and had to be reinstalled anyway. There was also no C compiler available anymore which needed further support from the hosting company. Not sure whether DBI was preinstalled ('core'?) though. I did try reinstalling modules shortly after the problem arose, to no avail.

      On a shared hosting server access and permissions are understandably limited.

      How should I challenge the 'perl scripts and modules are not compatible or wont work' response from the hoster, or is it possible that DBI needs patching to work with 5.26.3? I think they don't know much about Perl.

        DBI isn't core (see corelist), the error you are seeing is with /home/username/perl5/lib/perl5/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so: so not part of the new systems (new) perl anyway. I'm not a cpanel user, but this suggests it's adding the path I quoted to INC, causing the error you're seeing.

Re: Almalinux throwing Perl_xs_version_bootcheck undefined error
by NERDVANA (Priest) on Sep 03, 2023 at 06:19 UTC

    My advice would be to download /home/username/perl5 so that you have a backup, then completely delete /home/username/perl5/lib/perl5/* from the server. Then, create a cpanfile that lists every module that you need and upload that to your project directory, then (because I'm assuming you have local::lib active already) download the cpanm tool and use that to install all your modules listed in the cpanfile.

    # locally rsync -avxH mywebhost:perl5 . rsync -av cpanfile mywebhost:my_project_directory/
    # on web host ssh mywebhost rm -r ~/perl5/lib/perl5 mkdir ~/perl5/lib/perl5 cd ~/my_project_directory/ curl -L https://cpanmin.us | perl - App::cpanminus cpanm --installdeps .

    This is the standard recipe for re-installing the modules that your project needs on a new server. (or on a server where perl has been upgraded across major versions)

    If you don't have shell access on the server, just run those lines from "system" in a CGI script, though this is admittedly harder.