title: Is this a portable way to use PHP include?
body: <p>I'm making a website and I want to echo out some things to each page using PHP. </p>
  
  <p>The simple way: <code>include ('menu.php');</code> doesn't work, i get this:</p>
  
  <p><strong>Warning:</strong> include(menu.php): failed to open stream: No such file or directory in <strong>/home/folder/public_html/sitename.com/resources/page/index.php on line 82</strong></p>
  
  <p><strong>Warning:</strong> include(menu.php): failed to open stream: No such file or directory in <strong>/home/folder/public_html/sitename.com/resources/page/index.php on line 82</strong></p>
  
  <p><strong>Warning:</strong> include(): Failed opening 'menu.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in <strong>/home/folder/public_html/sitename.com/resources/page/index.php on line 82</strong></p>
  
  <p><strong><em>This is the method in question</em></strong> which works: <code>include(dirname(__FILE__).'../../../menu.php');</code></p>
  
  <p>This was my previous method which worked but isn't portable: <code>chdir('/home/folder/public_html/sitename.com'); include 'menu.php';</code> </p>