# vi copy_users.cgi
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "Done";
exit; (2)No such file or directory: AH01241: exec of '/home/user/www/cgi-bin/copy_users.cgi' failed
End of script output before headers: copy_users.cgi #!/usr/bin/perl
print "Content-type: text/plain\n\n";
print 'done';
exit; # diff copy_users.cgi test.cgi.bak
1,4c1,4
< #!/usr/bin/perl
<
< print "Content-type: text/plain\n\n";
< print 'done';
---
> #!/usr/bin/perl
>
> print "Content-type: text/plain\n\n";
> print 'done'; # hexdump -C copy_users.cgi
00000000 23 21 2f 75 73 72 2f 62 69 6e 2f 70 65 72 6c 0d |#!/usr/bin/perl.|
00000010 0a 0d 0a 70 72 69 6e 74 20 22 43 6f 6e 74 65 6e |...print "Conten|
00000020 74 2d 74 79 70 65 3a 20 74 65 78 74 2f 70 6c 61 |t-type: text/pla|
00000030 69 6e 5c 6e 5c 6e 22 3b 0d 0a 70 72 69 6e 74 20 |in\n\n";..print |
00000040 27 64 6f 6e 65 27 3b 0d 0a 65 78 69 74 3b |'done';..exit;|
0000004e
# hexdump -C test.cgi.bak
00000000 23 21 2f 75 73 72 2f 62 69 6e 2f 70 65 72 6c 0a |#!/usr/bin/perl.|
00000010 0a 70 72 69 6e 74 20 22 43 6f 6e 74 65 6e 74 2d |.print "Content-|
00000020 74 79 70 65 3a 20 74 65 78 74 2f 70 6c 61 69 6e |type: text/plain|
00000030 5c 6e 5c 6e 22 3b 0a 70 72 69 6e 74 20 27 64 6f |\n\n";.print 'do|
00000040 6e 65 27 3b 0a 65 78 69 74 3b |ne';.exit;|
0000004a
#!/usr/bin/perl
push @INC,'.';
use CGI::Carp qw (fatalsToBrowser);
print qq|Content-type: text/html\n\n|;
print "hi";
exit;
1; what OS is the desktop and the server?
you might want to try playing with the transfer data type in FileZilla [wiki.filezilla-project.org] for the .cgi files
I thought you would have run into that before Dude. Yes, you need to run unix line enders on unix. Windows Perl is not picky about enders and runs either. They will run from the cmd line, but for some reason apache barfs at it.
# perl copy_users.cgi
Content-type: text/plain
done [edited by: Brett_Tabke at 7:34 pm (utc) on Dec 27, 2022]
What text editor are you using? You should be able to specify Unix enders for everything right in your editor and not have to mess with the ftp conversion.