Sticky Posts
Dec 14, 2008
Weirdest PHP 5.2.6 BUG - One Liner From Hell
I was loading this site in Internet Explorer and it was timing out everytime! Same thing happened on my local server. WTF? I started to debug my 5hield but it was all ok so I went on looking for errors. Eventually I managed to find some hints about a file that was timing out. Guess what?! A CSS FILE! A one line CSS file that proves again that size does not matter ... when you're writing code.
The one liner CSS from hell
My txt,css,js files are handled dynamic:
<FilesMatch "\.(htm|html|php|vb|css|js|xml|txt)$">
SetHandler application/x-httpd-php
</FilesMatch>
I need this so I can cloack ;) my files. Like sitemap.xml and so on. But the CSS file causing the error was the weirdest thing. It was an IE hack file, a one line file starting with #. (I added the comment to fix this) Imagine: a one line file starting with a # can hog down a server with just a few loads generating infinite loops. What if the file is on a heavy hit site? Like mine ... ;)
PHP 5.2.8 is safe!
I quickly went to PHP.net and got the latest version. I tested it and it worked. No infinite loop, no CPU hunger, as it was meant to be. So ... 5.2.6 is apparently vulnerable to this freakish error and 5.2.8 is imune. So, my advice to you all is update. Or don't create one line files starting with a # and have PHP 5.2.6 run them. You may fix IE with a CSS hack but you may fk-up your server!


theres always one :/
It just turns out I’m using PHP 5.2.6! Thanks for the heads up and happy new year!