xjohnnyx Posted July 8, 2010 Posted July 8, 2010 While trying to run this basic Perl CGI script I get a 500 Internal Server Error: #!/usr/bin/perl use warnings; use strict; print "Content-type: text/html\n\n"; print 1; The error log in cpanel doesn't report anything so I'm kind of lost for ideas. The shebang line is in there and it's been changed to 755 permissions. It also doesn't work in my cgi bin. The script location is http://john.heliohost.org/cgiscript.pl Am I missing something? Any help is appreciated. Thanks and regards, John
Byron Posted July 8, 2010 Posted July 8, 2010 Escalating... Username: xjohnnyx Domain: john.heliohost.org
Ashoat Posted July 13, 2010 Posted July 13, 2010 Your file was written in Windows, and as such has carriage returns along with newlines. That messed up the CGI parser. Check now.
xjohnnyx Posted July 13, 2010 Author Posted July 13, 2010 Still 500 errors. I'm not sure how that would mess up the CGI parser though. I've run Perl CGI scripts on an Apache server that I built on CentOS before and wrote all my scripts in Notepad++ then uploaded just as I'm doing now via FTP, and had no problems. I'm surprised nobody has encountered this yet? Either you don't have a lot of CGI users or every CGI user runs Linux? Thanks for the help though! John
Byron Posted July 13, 2010 Posted July 13, 2010 FTP this small text file to your site and give it a .pl extension and chmod to 755 and see if it works for you. http://byrondallas.heliohost.org/time.txt
xjohnnyx Posted July 14, 2010 Author Posted July 14, 2010 Sure does! guess I have to program on my Linux box then?
Ashoat Posted July 14, 2010 Posted July 14, 2010 Not necessarily. One super-easy thing to do would be to just use a text editor that doesn't add the carriage return. Another option is to use whatever text editor, but then use the UNIX utility "dos2unix" to convert the carriage returns. You can get this on Windows with cygwin. Alternately, you could write your own script to do this - it shouldn't be too hard. There might even be something online.
Recommended Posts