Assist with diagnosing PHP include, failed to open stream
<p>I am attempting to move an old Intranet site running on Apache 2.2, to a WAMP setup (latest version) on my local machine.</p>

<p>One of the issues I have currently, is a <code>require_once</code> path failing to open, and I cannot determine what the cause is.</p>

<p>I have WAMP installed in:</p>

<pre><code>C:\Wamp
</code></pre>

<p>I have changed http.conf and vhosts.conf to change the document root from</p>

<pre><code>C:\Wamp\www
</code></pre>

<p>to</p>

<pre><code>C:\Wamp\www\Intranet
</code></pre>

<p>This folder contains an <code>index.php</code>, which I can see being loaded correctly when browsing to localhost.</p>

<p>Index.php has an iFrame that loads welcome.php from</p>

<pre><code>/site/welcome.php
</code></pre>

<p>This works, as the iFrame loads, but throws a 500 error.</p>

<p>Enabling PHP errors, the <code>welcome.php</code> page in the iFrame gives me an error on a <code>require_once</code>. The <code>require_once</code> is:</p>

<pre><code>/site/login/config.php.
</code></pre>

<p>As you can see, I am using absolute paths here, so the fact that index.php is able to load <code>/site/welcome.php</code>, tells me it is loading the correct file from:</p>

<pre><code>C:\Wamp\www\Intranet\site\welcome.php
</code></pre>

<p>I would expect then, my <code>require_once</code> with an absolute path to be loading:</p>

<pre><code>C:\Wamp\www\Intranet\site\login\config.php
</code></pre>

<p>Which is a valid file path.</p>

<p>What is confusing me, is that the first absolute path I am using, seems to be starting from the document root, not the physical directory root.</p>

<p>The second absolute path I am using, does not seem to be starting from the document root.</p>

<p>Even more interestingly, if I change the <code>require_once</code> from:</p>

<pre><code>/site/login/config.php
</code></pre>

<p>to</p>

<pre><code>/login/config.php
</code></pre>

<p>It works?! I wouldn't expect it to, as that would suggest the absolute path I am specifying, is in fact a relative path?</p>