"require" files not being found by alt Perl interp

 
Post new topic   Reply to topic    Aprelium Forum Index -> Perl
View previous topic :: View next topic  
Author Message
sjmonty
-


Joined: 28 Jun 2018
Posts: 5

PostPosted: Fri Jan 04, 2019 8:35 am    Post subject: "require" files not being found by alt Perl interp Reply with quote

Q. How can I make the alternate Perl interpreter (/usr/local/bin/perl) find my cgi-lib.pl file without having the define the full path? I have hundreds of .cgi files that would have to be changed if the full path is required. I'd rather not do that and foul up all of my timestamps.

DETAILS: I have had the need again to install another version of Perl. The one provided with the OS (/usr/bin/perl) keeps giving me errors when trying to install DBD::MySQL. The alternate/new install of Perl (/usr/local/bin/perl) installs DBD::MySQL correctly when run from the command line so I would like to continue using it. However, when I point Abyss to this new Perl interpreter (/usr/local/bin/perl), my existing/working .cgi scripts can't find my local "cgi-lib.pl" file. It is called within my scripts with the "require" statement. The "cgi-lib.pl" file exists right there in the same folder as the .cgi scripts themselves (cgi-bin). When I define the full path to cgi-lib.pl, it works. Also, when I point Abyss back to the built-in Perl interpreter (/usr/bin/perl), it works fine without the full path.
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Sat Jan 05, 2019 7:49 pm    Post subject: Re: "require" files not being found by alt Perl in Reply with quote

sjmonty,

The easiest solution is to add the location of the new module in the command line so that it becomes the first search location for requires.

To do so, edit the declaration of the Perl interpreter in Abyss Web Server and change it from:

Code:
/usr/local/bin/perl


to

Code:
/usr/local/bin/perl -I /path/of/the/new/module


Does this fix the problem?
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
sjmonty
-


Joined: 28 Jun 2018
Posts: 5

PostPosted: Sat Jan 05, 2019 9:16 pm    Post subject: Re: "require" files not being found by alt Perl in Reply with quote

Thank you for the suggestion but the server gives an error at the top when entering the location of the module (after the "-I") and clicking "OK".

"Error in Interpreter: File not found"


Last edited by sjmonty on Wed Jan 09, 2019 1:57 am; edited 1 time in total
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Fri Jan 11, 2019 5:48 pm    Post subject: Re: "require" files not being found by alt Perl in Reply with quote

sjmonty,

All our apologies. The instructions were not correct. In the Interpreter declaration, you should set the Interpreter field to
Code:
/usr/local/bin/perl


and the Arguments field to:

Code:
-I /path/of/the/new/module


Needless to say that /path/of/the/new/module should be changed to the actual path of the module on your system.

If the problem persists, please send us your abyss.conf file for review to our support email. Please do not forget to add a reference to this post.
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
sjmonty
-


Joined: 28 Jun 2018
Posts: 5

PostPosted: Fri Jan 11, 2019 9:42 pm    Post subject: Re: "require" files not being found by alt Perl in Reply with quote

That worked! Thank you.
Back to top View user's profile Send private message
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1295

PostPosted: Fri Jan 18, 2019 5:25 pm    Post subject: Re: "require" files not being found by alt Perl in Reply with quote

sjmonty wrote:
That worked! Thank you.


You're welcome.
_________________
Follow @abyssws on Twitter
Subscribe to our newsletter
_________________
Forum Administrator
Aprelium - https://aprelium.com
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Perl All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group