I am trying my hands for the first time in -> Apache – Perl (CGI) on Ubuntu.
The Apache server is working fine in the folder /var/www for the default index.html file. But since I want to run a CGI script, I also installed (just in case) DBI, as suggested by some forums. I set the permissions for complete access to my cgi-bin folder in which the select.cgi script resides. I tried tweaking the select.cgi script multiple times redirecting the library to the Perl library, but to no avail. I modified the httpd.conf file and set the directory path to the select.cgi folder. That didn’t work. I also defined ScriptAlias, and set it to the working directory. That didn’t work either.
Does anyone have any helpful pointers. Thanks.
In a comment, you gave information that contradicts what you gave originally. The latter information appears to be more reliable, so I’ll use it.
I believe you said the path to the module is
and that the error message you got (with line breaks added) is:
You did something like
or
Perl looked for
/etc/perl/foo/bar/Connection.pm/usr/local/lib/perl/5.14.2/foo/bar/Connection.pm/usr/lib/perl5/vendor_perl/5.8.5/foo/bar/foo/bar/Connection.pmBut none of those are
It’s simple to fix. Add the following to your script:
The other possible fix is to use
instead of
Which fix is the correct fix depends on what that
packageline in side the module looks like. If you findpackage foo::bar::Connection;, you need to modify@INC(as shown withuse lib, for example). If you findpackage Connection;, you need to change theuse` directive.