Article

Fix for error: malformed header from script. Bad header=<br /> - PHP 5.4

If your webserver throws a HTML 500 error and Apache error_log file shows "malformed header from script. Bad header=<br />", then you probably have a misconfigured php.ini file in your website root directory. Mine had a magic_quotes_cpg=On. I commented that line and the error is gone.

If you found another fix for the malformed header error, please leave a comment below.

Rate this article: 

Average: 4.6 (19 votes)

Comments

Thanks man!
This saved my day.

I fixed this error by commenting line "register_globals = on" in php.ini.

This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

If your webserver throws a HTML 500 error and Apache error_log file shows "malformed header from script. Bad header=<br />", then you probably have a misconfigured php.ini file in your website root directory.

 

Portfolio

Samples of work done for me or my customers, for free or not, like websites, repairs, photography etc.
View all my recent work

 

Tutorials

I'm giving away some knowledge in my areas of expertise. Did you like something here? Share it please!
View all tutorials

 

Snippets

Useful Linux commands or other code snippets I often use.
View my useful shortcuts

 

Resources

Few bookmarks I find useful. Do you want website here? Give me a good reason and I can help you.
View my favourite web resources

About me

Hi there! My name is Marius Cârneală.

About me?

Loving husband, dad of one two three, drone pilot, web designer and administrator, SEO specialist, IT support guy, electronic hobbyist and content writer. This list is open.