Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在cPanel操作的linux服务器上运行perl脚本?_Perl_Cpanel_Cgi Bin - Fatal编程技术网

如何在cPanel操作的linux服务器上运行perl脚本?

如何在cPanel操作的linux服务器上运行perl脚本?,perl,cpanel,cgi-bin,Perl,Cpanel,Cgi Bin,有谁能告诉我如何在服务器上运行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 . $_ } @

有谁能告诉我如何在服务器上运行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
在剧本的开头


我还可以尝试什么?

您可能需要执行位集:chmod+x filename.pl

在尝试运行脚本时,您会看到哪些错误?cPanel是个麻烦。遵循.cpanel,您的cgi应用程序一定会有错误日志吗?