mrj Posted September 12, 2017 Posted September 12, 2017 Hi,I am learning perl. I created a hello world example file called "test.pl" and the URL is: http://netrix.ml/cgi-bin/test.plWhen I visit this page via browser it returns 500 error. I'd chmoded it to 755. But still not worked. The test.pl contains following code:#!/usr/bin/perl print "content-type: text/html \n\n"; print "Hello, Perl!";
Luigi123 Posted September 12, 2017 Posted September 12, 2017 This support request is being escalated to our root admin.
Krydos Posted September 12, 2017 Posted September 12, 2017 You used the wrong file encoding http://netrix.ml/cgi-bin/test2.pl Linux is very particular about dos line endings. I recommend using the file manager in cpanel, then click the code editor button to make sure your files have proper linux encoding. Either that or you can use an editor like notepad++ on windows.
mrj Posted September 12, 2017 Author Posted September 12, 2017 which encode should I use? UTF-8 or something else. Please tell me.
Krydos Posted September 12, 2017 Posted September 12, 2017 Yes, UTF-8 will work. The main thing is it has to have linux line endings, not dos line endings.
mrj Posted September 17, 2017 Author Posted September 17, 2017 It's working when I save files with Linux line ending Thanks
Recommended Posts