## Installation

### Re: Can't locate DateTime.pm in @INC (you may need to install the DateTime module)

by L Ng -
Number of replies: 8
cpanm --uninstall App:Module right?

### Re: Can't locate DateTime.pm in @INC (you may need to install the DateTime module)

by Sukhjit Singh Sehra -

ln -s /opt/webwork/webwork2/conf/webwork.apache2.4-config /etc/httpd/conf.d/webwork.conf
I am trying to start the apache, but  I am getting the
AH00526: Syntax error on line 48 of /etc/httpd/conf.d/webwork.conf:
WEBWORK httpd[2179]: Can't locate DateTime.pm in @INC (you may need to install the DateTime module) (@INC contains: /opt/webwork/webwork2/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 /etc/httpd) at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 30.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 30.\nCompilation failed in require at /opt/webwork/webwork2/lib/WeBWorK/CourseEnvironment.pm line 57.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/CourseEnvironment.pm line 57.\nCompilation failed in require at (eval 5) line 1.\nBEGIN failed--compilation aborted at (eval 5) line 1.\n

I checked with check_modules.pl apache2.. all the packages are available but server is throwing above error!!

In reply to Sukhjit Singh Sehra

### Re: Can't locate DateTime.pm in @INC (you may need to install the DateTime module)

by Andrew Parker -

@INC:

/opt/webwork/webwork2/lib

/usr/local/lib64/perl5

/usr/local/share/perl5

/usr/lib64/perl5/vendor_perl

/usr/share/perl5/vendor_perl

/usr/lib64/perl5 /usr/share/perl5

/etc/httpd

Maybe try 'find'ing the DateTime.pm module? find /usr -name DateTime.pm

### Re: Can't locate DateTime.pm in @INC (you may need to install the DateTime module)

by Sukhjit Singh Sehra -

I ran 'find /usr -name DateTime.pm

and I was able to see it at:

What could be the reason  'webwork.conf' is not able to find it and throwing the syntax error as shared in the previous post?

Thanks for the help in advance.

In reply to Sukhjit Singh Sehra

### Re: Can't locate DateTime.pm in @INC (you may need to install the DateTime module)

by Andrew Parker -

Based on the @INC as you shared above, your system is not looking in /usr/local/perlbrew/... for modules.

Keep in mind, there's the 'system' perl, and then there's the various installation(s) of perl that you're managing with perlbrew. It seems that apache (via mod_perl) is using the system perl (and it's subdirectories -- as evidenced in the "@INC includes:" in the error message above) rather than perlbrew.

Is it possible that you have not enabled perlbrew for the root user? (I'm trying to figure out why your apache restarts are not using the perlbrew-installed version of perl.)

In order to be persistent, the last line (source /usr/local/perlbrew/etc/bashrc) needs to be added to the .bashrc file for the wwadmin user: /home/wwadmin/.bashrc; and should also be added for the root user as well.

### Re: Can't locate DateTime.pm in @INC (you may need to install the DateTime module)

by Sukhjit Singh Sehra -

One thing I did differently then tutorial was, I installed the following packages:
yum install expat-devel
yum install perl-ExtUtils-Embed
yum install mod_perl <--- is this a problem point, if yes what could be the remedy.
yum install httpd-devel

Is it also possible to update the entry at
# nano /etc/httpd/conf.modules.d/02-perl.conf
so that it can find the perl modules

PS: ( I have checked DateTime is available under /usr/local/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/x86_64-linux-thread-multi/DateTime.pm)
In reply to Sukhjit Singh Sehra

### Re: Can't locate DateTime.pm in @INC (you may need to install the DateTime module)

by Andrew Parker -

Yes, the problem is that you installed mod_perl via yum.

It should instead be installed with cpanminus after having compiled your own perl with perlbrew.

https://webwork.maa.org/wiki/Installation_Manual_for_2.16_on_RHEL8#Installing_Perl_Modules

I do not know how cleanly it will work to uninstall the system-mod_perl and re-install with cpanm mod_perl2` -- but that is what needs to happen. (When working on this installation guide, I tried many means of getting mod_perl installed in RHEL8 -- the only reason this guide has you install perlbrew and a custom perl is precisely to get mod_perl working.)

### Re: Can't locate DateTime.pm in @INC (you may need to install the DateTime module)

by Sukhjit Singh Sehra -

I had to start from scratch and now I have successfully built the server on oracle linux!!

Thanks for your constructive suggestions Prof Parker.

In reply to Sukhjit Singh Sehra

### Re: Can't locate DateTime.pm in @INC (you may need to install the DateTime module)

by Andrew Parker -

Glad to hear it! I can't tell you how many times I had to start from scratch in the process of developing those instructions... it's not pleasant, but sometimes it's the only way.