Is this violating the DRY principle?
Consider using existing template systems to help you that support inheritance. Template inheritance isn't a strict requirement, but is a powerful feature that makes maintaining templates a lot easier. Twig is easy to use, and feature-rich.

If you want to go it your own way, you could simply implement the use of layout files:

layout_default.php

&lt;!DOCTYPE HTML&gt;
&lt;?php $root="/mywebdir"; ?&gt;
&lt;html&gt;
&lt;head&gt;
&lt;?php include("$root/inc/meta.php"); ?&gt;
&lt;meta name="description" content="&lt;?php echo $description ?&gt;" /&gt;
&lt;meta name="keywords" content="&lt;?php echo keywords?&gt;" /&gt;
&lt;title&gt;&lt;?php echo $title ?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="main"&gt;
&lt;?php include("$root/inc/header.php"); ?&gt;
&lt;?php include("$root/inc/nav.php"); ?&gt;
&lt;div&gt;&lt;?php echo $contents ?&gt;&lt;/div&gt;
&lt;?php include("$root/inc/footer.php"); ?&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


example page.php

&lt;?php ob_start() ?&gt;
&lt;p&gt; main body html&lt;/p&gt;
&lt;?php
$title = "x"; 
$description = "x"; 
$keywords = "x"; 
$contents = ob_get_clean();
require 'layout_default.php'


This is a very crude implementation, simply enough to illustrate the principle.