CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Error: PL_tainting at /usr/lib64/perl5/DynaLoader.pm

 



Fishhead
Novice

May 3, 2016, 4:38 PM

Post #1 of 6 (1610 views)
Error: PL_tainting at /usr/lib64/perl5/DynaLoader.pm Can't Post

Over the past couple of weeks I have posted a couple of threads about this problem and had some very good feedback, but no definitive solution. Late last week I got radical and deleted all of the Perl program files from my server and requested tech support to re-install Perl. This has been accomplished. So let me give a brief over view.

My site 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 for the website and database to the new location and I have been testing everything before I have the DNS pointed to a 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. For speed in testing I have been using a "buy-it-now" feature rather than have to wait for an auction to end.

My main auction program begins as such:

Code
#!/usr/bin/perlml 


BEGIN {
my $base_module_dir = (-d '/home/jeffer36/perl' ? '/home/jeffer36/perl' : ( getpwuid($>) )[7] . '/perl/');
unshift @INC, map { $base_module_dir . $_ } @INC;
}

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;


When a test sale occurs I get this error message:

Quote
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /home/jeffer36/perl/home/jeffer36/perl5/lib/perl5 /home/jeffer36/perl/home/jeffer36/perl5/lib/perl5/x86_64-linux-thread-multi /home/jeffer36/perl/home/jeffer36/perl/usr/local/lib64/perl5 /home/jeffer36/perl/home/jeffer36/perl/usr/local/share/perl5 /home/jeffer36/perl/home/jeffer36/perl/usr/lib64/perl5/vendor_perl /home/jeffer36/perl/home/jeffer36/perl/usr/share/perl5/vendor_perl /home/jeffer36/perl/home/jeffer36/perl/usr/lib64/perl5 /home/jeffer36/perl/home/jeffer36/perl/usr/share/perl5 /home/jeffer36/perl/usr/local/lib64/perl5 /home/jeffer36/perl/usr/local/share/perl5 /home/jeffer36/perl/usr/lib64/perl5/vendor_perl /home/jeffer36/perl/usr/share/perl5/vendor_perl /home/jeffer36/perl/usr/lib64/perl5 /home/jeffer36/perl/usr/share/perl5 /home/jeffer36/perl. /home/jeffer36/perl5/lib/perl5 /home/jeffer36/perl5/lib/perl5/x86_64-linux-thread-multi /home/jeffer36/perl/usr/local/lib64/perl5 /home/jeffer36/perl/usr/local/share/perl5 /home/jeffer36/perl/usr/lib64/perl5/vendor_perl /home/jeffer36/perl/usr/share/perl5/vendor_perl /home/jeffer36/perl/usr/lib64/perl5 /home/jeffer36/perl/usr/share/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 16) line 3, <BUYERFILE> line 94.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Proxy, SQLite, Sponge.
at ../auction/buyit.pl line 284


Line 284 in "buyit.pl" is the code to connect to the database prior to inserting the new sales data and is as follows:


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


When I modify the main auction code, as had been suggested in earlier posts, as such:

Code
#!/usr/bin/perlml 


BEGIN {
my $base_module_dir = (-d '/home/jeffer36/perl' ? '/home/jeffer36/perl' : ( 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;


In this modified code I am pointing to where the DBD/mysql.pm file is located.

However, I immediately I receive the following error:

Quote
Can't load '/home/jeffer36/perl5/lib/perl5/x86_64-linux/auto/DBI/DBI.so' for module DBI: /home/jeffer36/perl5/lib/perl5/x86_64-linux/auto/DBI/DBI.so: undefined symbol: PL_tainting at /usr/lib64/perl5/DynaLoader.pm line 200.
at /home/jeffer36/perl5/lib/perl5/x86_64-linux/DBI.pm line 286
BEGIN failed--compilation aborted at /home/jeffer36/perl5/lib/perl5/x86_64-linux/DBI.pm line 286.
Compilation failed in require at auction.pl line 20.
BEGIN failed--compilation aborted at auction.pl line 20.


The version of Perl installed is: 5.10.1. The versions of the installed modules are:
CGI - 4.28
CGI::Sessions - 4.48
DBD::mysql - 1.2401 (though the documents indicate 4.033)
DBI - .015586

I could find very little about this last error message, particularly the last part:

Quote
PL_tainting at /usr/lib64/perl5/DynaLoader.pm line 200.


Suggestions?

Pete


FishMonger
Veteran / Moderator

May 3, 2016, 6:48 PM

Post #2 of 6 (1609 views)
Re: [Fishhead] Error: PL_tainting at /usr/lib64/perl5/DynaLoader.pm [In reply to] Can't Post

Where are you getting those version numbers from?

As I pointed out in your prior thread, the error message is telling you that you have a version conflict. The DBD::mysql module you're using was not compiled against the version of perl and or DBI module you're using. The fact that you found 2 separate version numbers for the DBD::mysql module would support that conclusion.

The version number you show for the DBI module doesn't look right. If you really are using version .015586, that would be a very old module. The current stable release of the DBI module is version 1.636.

Your begin block is also messing up your @INC array.

After you deleted all of the perl program files and had the admins reinstall perl, did they (or you) also reinstall all of the modules against that new perl installation, or were the modules simply copied over from some location rather than being built from source code?


FishMonger
Veteran / Moderator

May 3, 2016, 6:51 PM

Post #3 of 6 (1608 views)
Re: [Fishhead] Error: PL_tainting at /usr/lib64/perl5/DynaLoader.pm [In reply to] Can't Post

On a side note, please use the code tags around your code. I've added them for you in your post, but you need to remember to always use them when posting your code.


Fishhead
Novice

May 3, 2016, 7:22 PM

Post #4 of 6 (1604 views)
Re: [FishMonger] Error: PL_tainting at /usr/lib64/perl5/DynaLoader.pm [In reply to] Can't Post

FishMonger

The version numbers came from the listing within cPanel which shows the installed modules. For the four that I showed, I did a double check by reinstalling or updating each of the modules and checked the installation message at the end of the process with the values shown in the installation table. CGI and CGI::Sessions were both correct (4.28 and 4.48). As I noted before with DBD::mysql, the value in the installation table is 1.2401, but when I re-install, the installation message says it is 4.033. For DBI the installation table shows 0.015586, while the installation message says that version 1.636 was installed.

How should I change the BEGIN block so as to not mess-up the @INC array?

Once Perl was re-installed, I went to the cPanel and from there installed the necessary modules. The only files that were copied from the old server are webpage files and they went into cgi-bin.


FishMonger
Veteran / Moderator

May 3, 2016, 8:48 PM

Post #5 of 6 (1599 views)
Re: [Fishhead] Error: PL_tainting at /usr/lib64/perl5/DynaLoader.pm [In reply to] Can't Post


Quote
How should I change the BEGIN block so as to not mess-up the @INC array?

Get rid of it.

Take a look at the @INC paths in the error message. You'll notice that half of them have your home dir path prepended twice. It appears that your host has already configured your @INC array with your home directory, so prepending it a second time doesn't make any sense.

You'll probably need to talk with your host to find out what's going on with the version discrepancy of the modules and where cpanel installs them.


Fishhead
Novice

May 5, 2016, 12:13 AM

Post #6 of 6 (1592 views)
Re: [FishMonger] Error: PL_tainting at /usr/lib64/perl5/DynaLoader.pm [In reply to] Can't Post

FishMonger, I wish to once again thank you for your help.

I registered my concern about version discrepancy with the tech support folks and this is what said:

Quote
Your auction.pl script appeared to use the wrong perl binary. For testing purposes, I have set "#!/usr/local/bin/perl" instead of "#!/usr/bin/perlm1" in 'auction.pl' and that cleared the previous error.


I will not pretend that I understand how this change made things work, although perhaps I should learn, but it does seem to have resolved the problem that I have been having. It is odd however that the instructions in the cPanel clearly state to use: "#!/usr/bin/perlm1".

I post this for anyone else that may encounter a similar problem.

Thanks again.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives