In a mod_perl application running on ubuntu 16.04 after a certain while where everything functions fine (a few days) we get a fatal message in the errorlog:
failed to resolve handler
MyHandler::ModPerl20
Can't locate loadable object for module main in @INC
MyHander::ModPerl20 is defined in a location block
<Perl>
unshift @INC, '/path/to/my/code';
</Perl>
<Location ~ "/imp($|/)">
SetHandler modperl
PerlResponseHandler MyHandler::ModPerl20
</Location>
The ubuntu Perl Version is 5.22. Apache 2.4
Can this be the problem? http://blog.feature-addons.de/2016-05-15-otrs-apache-mod-perl-perl-5-22
Any ideas how to fix this? Do I really have to set up nginx/uwsgi?
Make sure @INC
is set up correctly, in order to find the path in which MyHandler::ModPerl20
is installed (I think what happens is that when Apache recycles some child, the one starting fresh do not have the correct @INC
value, hence not finding your module anymore).
Try to add a
PerlSwitches -I/your/path/for/myhandler/
in httpd.conf to see if it fixes your problem.
If that changes things, have a look at Adjusting @INC in modperl documentation to see all details.
Changing the MPM Apache configuration from mpm_event to mpm_prefork solved my problem.
It does not explain the error message though :( Any hints on this are appreciated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With