Can't locate RPC/XML.pm Perl and RPC XML - perl

I'm getting this error message when trying to to use the RPC XML with Perl.
Software error:
Can't locate RPC/XML.pm in #INC (#INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at test.pl line 9.
BEGIN failed--compilation aborted at test.pl line 9.
For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.
First I thought I didn't have XML-RPX installed. But when I look into a phpinfo()-file I find this:
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
How come this error shows up? It looks to me as it is installed and PHP "finds it". But not Perl.

PHP having an xmlrpc config is no indication that the RPC::XML Perl module is installed, and the error message strongly suggests that it isn't (If it is, then it is outside the Perl library paths).
You need to install the RPC::XML module.

Related

Perl throws "Can't locate Config/YAML.pm in #INC"

I'm getting Can't locate Config/YAML.pm in #INC (you may need to install the Config::YAML module) while running a perl script.
Can't locate Config/YAML.pm in #INC (you may need to install the
Config::YAML module) (#INC contains: /etc/perl
/usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18
/usr/local/lib/site_perl .) at myperlscript line 8. BEGIN
failed--compilation aborted at myperlscript line 8.
Line 8 of the script shows use Config::YAML;.
I'm using Ubuntu and have installed the libdata-yaml-perl and libyaml-perl packages, but still am getting the same error. What else is needed?
Config::YAML requires a different package. Install the libconfig-yaml-perl package and the problem will be fixed.
As the error says, something is missing in #INC. If you do have the module installed (perldoc -l YAML::Tiny for example) it might be installed in a location that is not added to #INC (see How is Perl's #INC constructed? (aka What are all the ways of affecting where Perl modules are searched for?) for how it's constructed).
That means that there could be something wrong with environment variables: if for example PERL5LIB is not set (or not set correctly), it could also cause this error.
For example, if Perl is installed in /home/myusername/perl5, setting PERL5LIB="/home/myusername/perl5/lib/perl5" can fix this (e.g. in your ~/.profile, don't forget to log out and in).
For reference, here is what my Perl installation had autogenerated:
PATH="/home/myusername/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/home/myusername/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/myusername/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/myusername/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/myusername/perl5"; export PERL_MM_OPT;

Cannot use already installed Perl Module on cPanel

I have already successfully installed the Perl module Crypt::CBC on cPanel.
But when adding the line "use Crypt::CBC;" I am getting the error:
Can't locate Crypt/CBC.pm in #INC (#INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at sagepay.pl line 128.
BEGIN failed--compilation aborted at sagepay.pl line 128.
Did I miss something? Quite new to Perl modules installation.
check the value of #INC by running this using your web server:
perl -e 'print "Content-type: text/plain\r\n\r\n" . join(":",#INC);'
#INC is where perl looks for modules. Perhaps they got installed in the wrong location.
You can add new locations with perl's -I option (see "man perlrun" for details)
I suspect that you may have added the module to cPanel instead of to the system Perl, for which you need to use WHM. Take a look at these instructions and follow the directions headed Install modules to the system Perl binary
Thanks everyone! Just a wrong path, I used this and it now works:
use lib '/data01/c1501978/perl/usr/lib/perl5';

Bioperl library installation in mysql server

I installed Bioperl and works correctly.
then installed Bio::Tools::Run::Phylo::Phyml and it works good from terminal.
But when I call same script contains it from a browser to using CGI method, I get this error:
Can't locate Bio/Tools/Run/Phylo/Phyml.pm in #INC (#INC contains:
/etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2
/usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14
/usr/share/perl/5.14 /usr/local/lib/site_perl . /etc/apache2) at
/var/www/Adol/mafToPhyML1.pl line 14.\nBEGIN failed--compilation
aborted at /var/www/Adol/mafToPhyML1.pl line 14.
I got this message from error.log
This post is similar to your question. You need to properly set #INC in your cgi script. Add a use lib pragma to your cgi script with the directory that contains the Bio directory of where your Phyml.pm is located.

Getting error "Can't locate HTML/TreeBuilder/XPath.pm in #INC "

Gettin below error while running my perl file
Can't locate HTML/TreeBuilder/XPath.pm in #INC (#INC contains: C:/Perl/lib C:/Pe
rl/site/lib .) at display.pl line 4.
BEGIN failed--compilation aborted at display.pl line 4.
HTML::TreeBuilder::XPath module(0.14) is installed. From command line when i run command
perl -e HTML::TreeBuilder::XPath it doesn't give any error.
when i run from command line perldoc -l HTML::TreeBuilder::XPath gives below error:
No documentation found for "HTML::TreeBuilder::XPath".
My perl version is 5.8.7
First cross check does this module is really installed ? I think it is not installed, install it from cpan.

Whats does the Perl error "Can't locate Net/SSH/Perl.pm" mean?

I am running a perl script that uses SSH, but it prints the following error:
Can't locate Net/SSH/Perl.pm in #INC (#INC contains: /etc/perl
/usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10
/usr/local/lib/site_perl .) at newone.pl line 3. BEGIN
failed--compilation aborted at newone.pl line 3.
Perl can't seem to locate Net/SSH/Perl.pm. Why can't it find it and how do I install it?
Your code is fine, although I haven't checked it as the error is due to a missing perl module.
What's the easiest way to install a missing Perl module?
You need to install and/or include the appropriate SSH library for perl. You can install it using this command:
cpan install Net::SSH::Perl