Perl错误:无法在@INC XFileSharing 2.5中找到XFileConfig.pm

时间:2017-07-29 17:31:04

标签: linux apache perl debian

我正在尝试安装 XFileSharing 2.5。

我使用的是Debian 8 64bit

我安装了apache2,mod_perl,激活了mod_rewrite等。 cgi-bin位置位于:/ usr / lib / cgi-bin(运行perl脚本的文件夹)

我有/ var / www / html(包含HTML文件的文件夹)

我按照这些说明操作:     https://pastebin.com/47vARv60

我在" 2)将install.cgi权限设置为755.然后在浏览器中打开它(例如server.com/cgi-bin/install.cgi)"  问题从这里开始。

Internal Server Error

The server encountered an internal error or misconfiguration and was unable 
to complete your request.

Please contact the server administrator at webmaster@localhost to inform them 
of the time this error occurred, and the actions you performed just before 
this error.

More information about this error may be available in the server error log.

所以我去了apache日志,看看发生了什么。

这是错误" [星期六7月29日18:54:06.695645 2017] [:错误] [pid 18153:tid 140636055983872]无法找到XFileConfig.pm在@INC中(您可能需要安装XFileConfig模块)(@INC包含:./ etc / perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 / usr / local / share / perl / 5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 / usr / share / perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 / usr / local / lib / site_perl / etc / apache2)位于/usr/lib/cgi-bin/install.cgi第4行。\ n \ nBEGIN失败 - 编译在/usr/lib/cgi-bin/install.cgi第4行中止。\ n&# 34;

似乎无法找到XFileConfig.pm但该文件存在。

root@Server:~# updatedb
root@Server:~# locate XFileConfig.pm
/usr/lib/cgi-bin/XFileConfig.pm

该文件位于" /usr/lib/cgi-bin/XFileConfig.pm" install.cgi文件位于/usr/lib/cgi-bin/install.cgi。

为什么似乎无法找到文件?这是install.cgi代码。 https://pastebin.com/LHjcSEDK

我花了好几个小时试图解决这个问题。

所以我决定来这里看看是否有人能比我更聪明。

2 个答案:

答案 0 :(得分:2)

脚本有问题。它错误地假定当前目录设置为脚本所在的目录。要解决此问题,请替换

use lib '.';

use FindBin qw( $RealBin );
use lib $RealBin;

答案 1 :(得分:2)

最有可能是因为您使用mod_perl处理程序运行它。 XFilesharing Pro必须在常规CGI环境下运行。尝试禁用mod_perl - 这应该可以解决您的问题。