diff --git a/src/Mouf/Html/Template/BootstrapTemplate.php b/src/Mouf/Html/Template/BootstrapTemplate.php
index 7336c8c..240e615 100644
--- a/src/Mouf/Html/Template/BootstrapTemplate.php
+++ b/src/Mouf/Html/Template/BootstrapTemplate.php
@@ -135,7 +135,9 @@ public function toHtml()
// Let's register the template renderer in the default renderer.
$this->getDefaultRenderer()->setTemplateRenderer($this->getTemplateRenderer());
- header('Content-Type: text/html; charset=utf-8');
+ if (PHP_SAPI !== 'cli') {
+ header('Content-Type: text/html; charset=utf-8');
+ }
//Renderable::toHtml();// __DIR__."/../../../../views/template.php";
$this->toHtmlRenderer();
}