Solved mystery – perl on XAMPP won’t run modified scripts “End of script output before headers”

Friday 4 April 2014 @ 10:20 am

Nice, WTFish riddle for You today. Imagine this – there is a XAMPP server – Windows, apache, Perl and PHP (from www.apachefriends.org) installed on your laptop.

I hope the previous sentence did not put you off, linux fans 😉

Still with me?  Read on: you have a typical hello world type perl script, serving as an example and test, that is delivered with that whole bunch.

It works. Shows “OK” via CGI.


#!"C:\xampp\perl\bin\perl.exe" 
 
print "Content-Type: text/html\n\n"; 
print "OK";

You write your own small script – get server error 500 – “End of script output before headers“.

You put your script in the same directory as that example – still get 500.

You copy your example script to other file in the same directory and edit it – 500.

You copy your example script to other file in the same directory and NOT edit it this time  – 500.

You edit your example script (that original file) , do the slightest change – for example change string to “OK2”  – 500.

You edit your example script back to be exactly as it was before – it works.

WTF?

Good text editor was used – Notepad++ (saving as UTF8 without BOM, line endings were not messed with), so it was not the cause of problems.

The problem was encountered by more than one person (1st, 2nd).

Guess where the problem was.

You can think for yourself, the answer to the riddle, cause and solution is below (scroll if you have no idea)

 

 

 

 

 

 

 

 

 

 

.

 

 

 

 

 

 

 

 

 

 

 

.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.

 

 

 

 

 

 

 

 

 

 

.

 

 

 

The antivirus/firewall program, COMODO Internet Security was causing the problem. It did not allow to run neither new perl files, nor modified existing perl files. I guess it somehow accepted the original file that was created during XAMPP installation, but when someone tried to modify it or make new one – it won’t run.

Solution – temporarily turn off sandbox feature or the whole COMODO antivirus/firewall at all. Or change it to other product.

Was searched:

Tags:

Comments (1) - Posted in wtf by  




Warning: Creating default object from empty value in /home3/lech/public_html/baczynski.com/perl/wp-includes/comment-template.php on line 1056

 One response to “Solved mystery – perl on XAMPP won’t run modified scripts “End of script output before headers””

Leave a comment