Not sure if this is a PHP issue or Apache, but I suspect the latter. My apologies if this is posted in the wrong place.
I have subdomains set up in my local dev environment, and I've been using the following code for a website while I work on it locally:
<?php
include($_SERVER['DOCUMENT_ROOT'] . "/includes/header.php");
?>
It worked flawlessly for weeks, but then I stopped work on it for about a month. Last night I went back to work on it, and it's broken. I am now getting this:
Warning: include(C:/web/Apache/htdocs/includes/header.php): failed to open stream: No such file or directory in C:\web\Apache\htdocs\sitename\index.php on line 6
Warning: include(): Failed opening 'C:/web/Apache/htdocs/includes/header.php' for inclusion (include_path='.;C:\php\pear') in C:\web\Apache\htdocs\sitename\index.php on line 6
Notice how 'sitename' (the root) appears in the second part of each warning but not the first. :-/
'Line 6' that's mentioned in the warning is simply
include($_SERVER['DOCUMENT_ROOT'] . "/includes/header.php");
The
key factor here is that
I have not changed a single thing about the project since I last worked on it. So I'm stumped as to why it is suddenly happening.
Restarted Apache, no go.
Rebooted computer, nothing.
Double checked code, still nothing.
I have an exact copy of the site on the remote server for testing with the host's server, and the code is exactly the same, but works as expected. So the problem is definitely local.
My suspicions are leaning towards any of the Windows updates that occurred during the month away from working on the project.
Does anyone have an idea of what might cause this sort of thing out the blue?