Can't locate <module>.pm in @INC even though it path exists and worksoutside mod_perl

--000325575ae64034ab0497aa1560
Content-Type: text/plain; charset=ISO-8859-1

Dear Friends,

I have started using mod_perl recently and facing following difficulties in
terms of running a script which depends on some custom (home grown) modules.

When i execute Apache error log reports that it cannot locate the module in
[at] INC path even though the path very much exists and i am able to run the
script without any issues outside mod_perl

Basically, Here is my setup

1) Modules are located under /opt/tools/perl/lib
2) [at] INC containts /opt/tools/perl/lib
- This is also confirmed by http://localhost/perl-status
3) Web perl scripts are located at /var/www/perl and apache is properly
configured
- This is confirmed by executing a script which does not
depend on any external modules
4) Now if i execute a perl script which has "use <module>;" pragma, it
fails if this module is located under custom path, but works well for
modules which are intalled with perl distribution

Any clue is appreciated.

Thanks in advance,
Aruljothi.S

--000325575ae64034ab0497aa1560
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Dear Friends,<br><br>=A0I have started using mod_perl recently and facing f=
ollowing difficulties in terms of running a script which depends on some cu=
stom (home grown) modules.<br><br>=A0When i execute Apache error log report=
s that it cannot locate the module in [at] INC path even though the path very m=
uch exists and i am able to run the script without any issues outside mod_p=
erl<br>
<br>=A0Basically, Here is my setup<br><br>=A01) Modules are located under /=
opt/tools/perl/lib<br>=A02) [at] INC containts /opt/tools/perl/lib<br>=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 - This is also confirmed by <a href=3D"http:=
//localhost/perl-status">http://localhost/perl-status</a><br>
=A03) Web perl scripts are located at /var/www/perl and apache is properly =
configured<br>=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 - This is confirmed by =
executing a script which does not depend on any external modules<br>=A04) N=
ow if i execute a perl script which has "use <module>;" pra=
gma, it fails if this module is located under custom path, but works well f=
or modules which are intalled with perl distribution<br>
<br>=A0Any clue is appreciated.<br><br>Thanks in advance,<br>Aruljothi.S<br=
>

--000325575ae64034ab0497aa1560--
ArulJothi [ Sa, 18 Dezember 2010 08:17 ] [ ID #2051801 ]

Re: Can't locate <module>.pm in @INC even though it path exists andworks outside mod_perl

ArulJothi wrote:
> Dear Friends,
>
> I have started using mod_perl recently and facing following difficulties in
> terms of running a script which depends on some custom (home grown) modules.
>
> When i execute Apache error log reports that it cannot locate the module in
> [at] INC path even though the path very much exists and i am able to run the
> script without any issues outside mod_perl
>
> Basically, Here is my setup
>
> 1) Modules are located under /opt/tools/perl/lib
> 2) [at] INC containts /opt/tools/perl/lib
> - This is also confirmed by http://localhost/perl-status
> 3) Web perl scripts are located at /var/www/perl and apache is properly
> configured
> - This is confirmed by executing a script which does not
> depend on any external modules
> 4) Now if i execute a perl script which has "use <module>;" pragma, it
> fails if this module is located under custom path, but works well for
> modules which are intalled with perl distribution
>
> Any clue is appreciated.
>
When it fails, there is an error message in the Apache log.
What /exactly/ does that message say ? (copy it here)
aw [ Sa, 18 Dezember 2010 10:21 ] [ ID #2051802 ]

Re: Can't locate <module>.pm in @INC even though it path exists and works outside mod_perl

On Saturday, December 18, 2010 08:17:43 ArulJothi wrote:
> When i execute Apache error log reports that it cannot locate the module
> in [at] INC path even though the path very much exists and i am able to run
> the script without any issues outside mod_perl
>
> Basically, Here is my setup
>
> 1) Modules are located under /opt/tools/perl/lib
> 2) [at] INC containts /opt/tools/perl/lib
> - This is also confirmed by http://localhost/perl-status
> 3) Web perl scripts are located at /var/www/perl and apache is properly
> configured
> - This is confirmed by executing a script which does not
> depend on any external modules
> 4) Now if i execute a perl script which has "use <module>;" pragma, it
> fails if this module is located under custom path, but works well for
> modules which are intalled with perl distribution

Are you sure the scripts are run by mod_perl instead of mod_cgi? If you are=

using mod_cgi use SetEnv to propagate the custom search path to the module.

Torsten Förtsch

=2D-
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net
torsten.foertsch [ Sa, 18 Dezember 2010 11:42 ] [ ID #2051803 ]

Re: Can't locate <module>.pm in @INC even though it path exists andworks outside mod_perl

--0022152d60a9f5c5260497af1ee9
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Torsten Fortsch,

Thanks for looking into the issue.

I think i am running using mod_perl and not mod_cgi, but How to identify i=
t
properly.

Anyway here is my error details

*URL of my execution:* http://localhost/opt/bi.pl

*Content of bi.pl:*
$ cat bi.pl
use od_os;
print "hi\n";

* Location of od_os.pm on web server*
$ ls /opt/tools/perl/od_cmn/lib/od_os.pm
/opt/tools/perl/od_cmn/lib/od_os.pm

* Error on Apache server log*
[Sat Dec 18 18:41:38 2010] [error] Can't locate od_os.pm in [at] INC ( [at] INC
contains: /opt/tools/perl/cmn/lib /opt/tools/perl/od_cmn/lib
/usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-mult i
/usr/local/lib/perl5/site_perl/5.10.0
/usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0
/usr/lib/perl5/site_perl . /etc/httpd) at /var/www/optim/bi.pl line
1.\nBEGIN failed--compilation aborted at /var/www/optim/bi.pl line 1.\n

Thanks & Regards,
Aruljothi.S

2010/12/18 Torsten Förtsch <torsten.foertsch [at] gmx.net>

> On Saturday, December 18, 2010 08:17:43 ArulJothi wrote:
> > When i execute Apache error log reports that it cannot locate the modu=
le
> > in [at] INC path even though the path very much exists and i am able to run
> > the script without any issues outside mod_perl
> >
> > Basically, Here is my setup
> >
> > 1) Modules are located under /opt/tools/perl/lib
> > 2) [at] INC containts /opt/tools/perl/lib
> > - This is also confirmed by http://localhost/perl-status
> > 3) Web perl scripts are located at /var/www/perl and apache is properl=
y
> > configured
> > - This is confirmed by executing a script which does not
> > depend on any external modules
> > 4) Now if i execute a perl script which has "use <module>;" pragma, it
> > fails if this module is located under custom path, but works well for
> > modules which are intalled with perl distribution
>
> Are you sure the scripts are run by mod_perl instead of mod_cgi? If you a=
re
> using mod_cgi use SetEnv to propagate the custom search path to the modul=
e.
>
> Torsten Förtsch
>
> --
> Need professional modperl support? Hire me! (http://foertsch.name)
>
> Like fantasy? http://kabatinte.net
>

--0022152d60a9f5c5260497af1ee9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Torsten Fortsch,<br><br>=A0Thanks for looking into the issue.<br><br>=A0I t=
hink i am running using mod_perl and not mod_cgi, but How to identify it pr=
operly.<br><br>=A0Anyway here is my error details<br><br>=A0<b>URL of my ex=
ecution:</b> <a href=3D"http://localhost/opt/bi.pl">http://localhost/opt/bi=
..pl</a><br>
<br>=A0<b>Content of <a href=3D"http://bi.pl">bi.pl</a>:</b><br>=A0$ cat <a=
href=3D"http://bi.pl">bi.pl</a><br>=A0=A0=A0 use od_os;<br>=A0=A0=A0 print=
"hi\n";<br><br><b>=A0Location of <a href=3D"http://od_os.pm">od_=
os.pm</a> on web server</b><br>
=A0$ ls /opt/tools/perl/od_cmn/lib/<a href=3D"http://od_os.pm">od_os.pm</a>=
<br>/opt/tools/perl/od_cmn/lib/<a href=3D"http://od_os.pm">od_os.pm</a><br=
><br><b>=A0Error on Apache server log</b><br>[Sat Dec 18 18:41:38 2010] [er=
ror] Can't locate <a href=3D"http://od_os.pm">od_os.pm</a> in [at] INC ( [at] IN=
C contains: /opt/tools/perl/cmn/lib /opt/tools/perl/od_cmn/lib /usr/local/l=
ib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site=
_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr=
/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.1=
0.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl =
.. /etc/httpd) at /var/www/optim/<a href=3D"http://bi.pl">bi.pl</a> line 1.\=
nBEGIN failed--compilation aborted at /var/www/optim/<a href=3D"http://bi.p=
l">bi.pl</a> line 1.\n<br>
<br>Thanks & Regards,<br>Aruljothi.S<br><br><div class=3D"gmail_quote">=
2010/12/18 Torsten Förtsch <span dir=3D"ltr"><<a href=3D"mailto:torste=
n.foertsch [at] gmx.net">torsten.foertsch [at] gmx.net</a>></span><br><blockquote =
class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); m=
argin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class=3D"im">On Saturday, December 18, 2010 08:17:43 ArulJothi wrote:<=
br>
> =A0When i execute Apache error log reports that it cannot locate the m=
odule<br>
> in [at] INC path even though the path very much exists and i am able to ru=
n<br>
> the script without any issues outside mod_perl<br>
><br>
> =A0Basically, Here is my setup<br>
><br>
> =A01) Modules are located under /opt/tools/perl/lib<br>
> =A02) [at] INC containts /opt/tools/perl/lib<br>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 - This is also confirmed by <a href=3D"htt=
p://localhost/perl-status" target=3D"_blank">http://localhost/perl-status</=
a><br>
> =A03) Web perl scripts are located at /var/www/perl and apache is prop=
erly<br>
> configured<br>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 - This is confirmed by executing a script =
which does not<br>
> depend on any external modules<br>
> =A04) Now if i execute a perl script which has "use <module>=
;;" pragma, it<br>
> fails if this module is located under custom path, but works well for<=
br>
> modules which are intalled with perl distribution<br>
<br>
</div>Are you sure the scripts are run by mod_perl instead of mod_cgi? If y=
ou are<br>
using mod_cgi use SetEnv to propagate the custom search path to the module.=
<br>
<br>
Torsten Förtsch<br>
<font color=3D"#888888"><br>
--<br>
Need professional modperl support? Hire me! (<a href=3D"http://foertsch.nam=
e" target=3D"_blank">http://foertsch.name</a>)<br>
<br>
Like fantasy? <a href=3D"http://kabatinte.net" target=3D"_blank">http://kab=
atinte.net</a><br>
</font></blockquote></div><br>

--0022152d60a9f5c5260497af1ee9--
ArulJothi [ Sa, 18 Dezember 2010 14:18 ] [ ID #2051805 ]

Re: Can't locate <module>.pm in @INC even though it path exists andworks outside mod_perl

--00221532c778d427070497afc9de
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Torsten Fortsch,

I just found the solution, it is very silly. /opt/optimtools points to a
directory under a user home directory which does not have enough permission=
s
on home directory to read.

Anyway thanks for the effort.

Thanks & Regards,,
Aruljothi.S

2010/12/18 ArulJothi <aruljothi [at] gmail.com>

> Torsten Fortsch,
>
> Thanks for looking into the issue.
>
> I think i am running using mod_perl and not mod_cgi, but How to identify
> it properly.
>
> Anyway here is my error details
>
> *URL of my execution:* http://localhost/opt/bi.pl
>
> *Content of bi.pl:*
> $ cat bi.pl
> use od_os;
> print "hi\n";
>
> * Location of od_os.pm on web server*
> $ ls /opt/tools/perl/od_cmn/lib/od_os.pm
> /opt/tools/perl/od_cmn/lib/od_os.pm
>
> * Error on Apache server log*
> [Sat Dec 18 18:41:38 2010] [error] Can't locate od_os.pm in [at] INC ( [at] INC
> contains: /opt/tools/perl/cmn/lib /opt/tools/perl/od_cmn/lib
> /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-mult i
> /usr/local/lib/perl5/site_perl/5.10.0
> /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl
> /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0
> /usr/lib/perl5/site_perl . /etc/httpd) at /var/www/optim/bi.pl line
> 1.\nBEGIN failed--compilation aborted at /var/www/optim/bi.pl line 1.\n
>
> Thanks & Regards,
> Aruljothi.S
>
> 2010/12/18 Torsten Förtsch <torsten.foertsch [at] gmx.net>
>
> On Saturday, December 18, 2010 08:17:43 ArulJothi wrote:
>> > When i execute Apache error log reports that it cannot locate the
>> module
>> > in [at] INC path even though the path very much exists and i am able to ru=
n
>> > the script without any issues outside mod_perl
>> >
>> > Basically, Here is my setup
>> >
>> > 1) Modules are located under /opt/tools/perl/lib
>> > 2) [at] INC containts /opt/tools/perl/lib
>> > - This is also confirmed by http://localhost/perl-status
>> > 3) Web perl scripts are located at /var/www/perl and apache is proper=
ly
>> > configured
>> > - This is confirmed by executing a script which does not
>> > depend on any external modules
>> > 4) Now if i execute a perl script which has "use <module>;" pragma, i=
t
>> > fails if this module is located under custom path, but works well for
>> > modules which are intalled with perl distribution
>>
>> Are you sure the scripts are run by mod_perl instead of mod_cgi? If you
>> are
>> using mod_cgi use SetEnv to propagate the custom search path to the
>> module.
>>
>> Torsten Förtsch
>>
>> --
>> Need professional modperl support? Hire me! (http://foertsch.name)
>>
>> Like fantasy? http://kabatinte.net
>>
>
>

--00221532c778d427070497afc9de
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Torsten Fortsch,<br><br>=A0I just found the solution, it is very silly. /op=
t/optimtools points to a directory under a user home directory which does n=
ot have enough permissions on home directory to read.<br><br>=A0Anyway than=
ks for the effort.<br>
<br>Thanks & Regards,,<br>Aruljothi.S<br><br><div class=3D"gmail_quote"=
>2010/12/18 ArulJothi <span dir=3D"ltr"><<a href=3D"mailto:aruljothi [at] gma=
il.com">aruljothi [at] gmail.com</a>></span><br><blockquote class=3D"gmail_qu=
ote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0p=
t 0.8ex; padding-left: 1ex;">
Torsten Fortsch,<br><br>=A0Thanks for looking into the issue.<br><br>=A0I t=
hink i am running using mod_perl and not mod_cgi, but How to identify it pr=
operly.<br><br>=A0Anyway here is my error details<br><br>=A0<b>URL of my ex=
ecution:</b> <a href=3D"http://localhost/opt/bi.pl" target=3D"_blank">http:=
//localhost/opt/bi.pl</a><br>

<br>=A0<b>Content of <a href=3D"http://bi.pl" target=3D"_blank">bi.pl</a>:<=
/b><br>=A0$ cat <a href=3D"http://bi.pl" target=3D"_blank">bi.pl</a><br>=A0=
=A0=A0 use od_os;<br>=A0=A0=A0 print "hi\n";<br><br><b>=A0Locatio=
n of <a href=3D"http://od_os.pm" target=3D"_blank">od_os.pm</a> on web serv=
er</b><br>

=A0$ ls /opt/tools/perl/od_cmn/lib/<a href=3D"http://od_os.pm" target=3D"_b=
lank">od_os.pm</a> <br>/opt/tools/perl/od_cmn/lib/<a href=3D"http://od_os.p=
m" target=3D"_blank">od_os.pm</a><br><br><b>=A0Error on Apache server log</=
b><br>[Sat Dec 18 18:41:38 2010] [error] Can't locate <a href=3D"http:/=
/od_os.pm" target=3D"_blank">od_os.pm</a> in [at] INC ( [at] INC contains: /opt/tool=
s/perl/cmn/lib /opt/tools/perl/od_cmn/lib /usr/local/lib/perl5/site_perl/5.=
10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib=
/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_per=
l/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.10.0/i386-linux-thread=
-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl . /etc/httpd) at /var=
/www/optim/<a href=3D"http://bi.pl" target=3D"_blank">bi.pl</a> line 1.\nBE=
GIN failed--compilation aborted at /var/www/optim/<a href=3D"http://bi.pl" =
target=3D"_blank">bi.pl</a> line 1.\n<br>

<br>Thanks & Regards,<br>Aruljothi.S<br><br><div class=3D"gmail_quote">=
2010/12/18 Torsten Förtsch <span dir=3D"ltr"><<a href=3D"mailto:torste=
n.foertsch [at] gmx.net" target=3D"_blank">torsten.foertsch [at] gmx.net</a>></spa=
n><div>
<div></div><div class=3D"h5"><br><blockquote class=3D"gmail_quote" style=3D=
"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padd=
ing-left: 1ex;">
<div>On Saturday, December 18, 2010 08:17:43 ArulJothi wrote:<br>
> =A0When i execute Apache error log reports that it cannot locate the m=
odule<br>
> in [at] INC path even though the path very much exists and i am able to ru=
n<br>
> the script without any issues outside mod_perl<br>
><br>
> =A0Basically, Here is my setup<br>
><br>
> =A01) Modules are located under /opt/tools/perl/lib<br>
> =A02) [at] INC containts /opt/tools/perl/lib<br>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 - This is also confirmed by <a href=3D"htt=
p://localhost/perl-status" target=3D"_blank">http://localhost/perl-status</=
a><br>
> =A03) Web perl scripts are located at /var/www/perl and apache is prop=
erly<br>
> configured<br>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 - This is confirmed by executing a script =
which does not<br>
> depend on any external modules<br>
> =A04) Now if i execute a perl script which has "use <module>=
;;" pragma, it<br>
> fails if this module is located under custom path, but works well for<=
br>
> modules which are intalled with perl distribution<br>
<br>
</div>Are you sure the scripts are run by mod_perl instead of mod_cgi? If y=
ou are<br>
using mod_cgi use SetEnv to propagate the custom search path to the module.=
<br>
<br>
Torsten Förtsch<br>
<font color=3D"#888888"><br>
--<br>
Need professional modperl support? Hire me! (<a href=3D"http://foertsch.nam=
e" target=3D"_blank">http://foertsch.name</a>)<br>
<br>
Like fantasy? <a href=3D"http://kabatinte.net" target=3D"_blank">http://kab=
atinte.net</a><br>
</font></blockquote></div></div></div><br>
</blockquote></div><br>

--00221532c778d427070497afc9de--
ArulJothi [ Sa, 18 Dezember 2010 15:06 ] [ ID #2051806 ]
Webserver » gmane.comp.apache.mod-perl » Can't locate <module>.pm in @INC even though it path exists and worksoutside mod_perl

Vorheriges Thema: [ANNOUNCE] Apache-Test 1.34
Nächstes Thema: mod_perl 2 - %ENV variable