【发布时间】:2011-03-28 17:39:21
【问题描述】:
谁能告诉我如何在服务器上运行 perl 脚本。
我使用FTP上传它。通过在 cgi-bin 文件夹中添加 .pl 文件,脚本不起作用。我也试过用 cPanel 上传。
BEGIN {
my $base_module_dir = (-d '/home/username/perl' ?
'/home/username/perl' : ( getpwuid($>)
)[7] . '/perl/');
unshift @INC, map { $base_module_dir . $_ } @INC; }
对于最后一个选项,我什至尝试添加
#!/usr/bin/perl
在脚本的开头。
我还能尝试什么?
【问题讨论】:
-
您在尝试运行脚本时看到了哪些错误?
-
cPanel 是一个红鲱鱼。关注classic CGI trouble-shooting instructions。
-
cpanel 肯定会为您的 cgi 应用程序提供错误日志吗?