I’m trying to set up an apache server to show a map for FlightGear using FGMap. All the web server files for the map page are in /var/www/fgmap. It calls an fg_server_xml.cgi script, that tries to use a library at /var/www/fgmap/sg_perl/blib/lib/sgmath.pm. (Blib, for reference, is a symlink to another folder in the same directory – to /var/www/fgmap/sg_perl/blibx86-64)
fg_server_xml.cgi gives ma a 500 Internal Server Error when I try to access the page, and apache error logs show:
[Sat Jun 30 07:59:48 2012] [warn] -T switch is ignored, enable with 'PerlSwitches -T' in httpd.conf\n
[Sat Jun 30 07:59:48 2012] [error] Can't locate sgmath.pm in @INC (@INC contains: /var/www/sg_perl/blib/arch/auto/sgmath
/var/www/sg_perl/blib/lib /etc/perl /usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14
/usr/local/lib/site_perl . /etc/apache2)
at /var/www/fgmap/fg_server_xml.cgi line 14.\nBEGIN failed--compilation aborted at /var/www/fgmap/fg_server_xml.cgi
line 14.\n
However, I dropped another perl script, sg_test.pl into the same directory, that references the same library and runs one function from it and prints the output. This script works fine, and can find the library.
Why would one script, identical in its library calls to another and in the exact same location, be unable to find a file the other has no trouble accessing?
One of my theories is that Apache is trying to access it as a user that doesn’t have permissions or something to access the folder with sgmath.pm in it, so I made every folder/subfolder/file of WWW accessible to all users. Still no luck.
Apache can definitely use the .cgi, it’s no trouble with that, I made a test .cgi file that works just fine.
Thanks!
Edit: The library call in question
use lib "/var/www/sg_perl/blib/lib";
use lib "/var/www/sg_perl/blib/arch/auto/sgmath";
use sgmath;
Using
use lib, you addedbut you said the file is in
This latter path isn’t present in
@INC(as confirmed by checking the error message).