I have this issue on my server. It happens sometimes when I refresh my webpages. It seems litespeed wont pass file.php to php compiler and instead of rendering HTML and interpreting PHP, I will see my PHP source code. It won't happen always, only 2 or 3 times in 50 tries.

My PHP version is 5.3.10 but I had the same problem with 5.2.17 too. My Litespeed version is V5.5 on CentOS 6 (x64)


Normally that shouldn't happen on any webserver. This might be because of a glitch (if you are testing with the same page).

Try to reproduce it and submit a bug report if it persists.


You need to insure you've configured litespeed to parse PHP mime-types with PHP rather than just write them to standard out. You'd have the same issue on Apache if the mime-types weren't configured. If it truly is random and can't be linked to specific areas, etc, then it is likely a bug.

To add a PHP handler, you'd just add something along the lines of...

addType application/x-httpd-php5 php

Make sure your PHP files are always named with the extension that you specified in the handler.


After months of struggle finally i figured out that my .htaccress length was the problem. In other words if .htaccess file length exceed 17 of lines it will confuse Litespeed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.