in reply to Custom module is present but not read by Apache (?)

The file Error.pm lives in /srv/www/Direct/perl-lib/Portal, so the first line of that file will likely be:

package Portal::Error;

But the line that is problematic is use Error;. Maybe this is because there is no file Error.pm in @INC. Have you looked through the directories listed in @INC to see whether there is a file Error.pm? Maybe that line references Error.pm, but if so, that module is not installed.

Replies are listed 'Best First'.
Re^2: Custom module is present but not read by Apache (?)
by Anonymous Monk on Dec 10, 2019 at 12:43 UTC
    Yes, that stroke me also as weird. But, given that I "only" need to migrate this website, and I just took its files from the other location, wouldn't this be problematic for the current installation too? It seems to work without a problem there.. I am wondering if there is some setting that I have not done appropriately, my vhost conf file looks like this:
    <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname a +nd port that # the server uses to identify itself. This is used when creati +ng # redirection URLs. In the context of virtual hosts, the Serve +rName # specifies what hostname must appear in the request's Host: h +eader to # match this virtual host. For the default virtual host (this +file) this # value is not decisive as it is used as a last resort host re +gardless. # However, you must set it for any further virtual host explic +itly. #ServerName www.example.com ServerAdmin webmaster@example.com ServerName xxx.xxx.xx.xx DocumentRoot /srv/www/Direct/htdocs/ # Available loglevels: trace8, ..., trace1, debug, info, notic +e, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn #ErrorLog ${APACHE_LOG_DIR}/error.log #CustomLog ${APACHE_LOG_DIR}/access.log combined ErrorLog /srv/www/Direct/error_directwebdemo.log ScriptAlias "/cgi-bin/" "/srv/www/Direct/cgi-bin/" <Directory "/srv/www/Direct/cgi-bin"> AllowOverride None Options +ExecCGI -Includes Order allow,deny Allow from all </Directory> # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For exa +mple the # following line enables the CGI configuration for this host o +nly # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    For Centos with Apache 2.4.

      Since a CGI script is merely a normal program that has some expectations on its input and output, you can simply run the program and look if (and what) errors get printed.

      If the program works on the old machine, look at the contents of @INC on the old machine. Somewhere there is Error.pm, while it is not available on the new machine.

        Thanks a lot for your time @Corion. The contents look kind of similar to me: OLD
        /usr/lib/perl5/5.12.3/x86_64-linux-thread-multi /usr/lib/perl5/5.12.3/ /usr/lib/perl5/vendor_perl/5.12.3/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.12.3 /usr/lib/perl5/5.12.3/x86_64-linux-thread-multi /usr/lib/perl5/5.12.3
        NEW
        /root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi /root/perl5/lib/perl5/5.16.3 /root/perl5/lib/perl5/x86_64-linux-thread-multi /root/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5