For a while I've been testing projects on a server and then uploading it to the correct folders. Recently I decided to try using XAMPP for increased security and less hassle when testing; so I installed it, imported the database and copied the files to the htdocs
folder.
Includes and requires seem to be working fine, but the one instance where it fails is when I try to access a parent folder, i.e. require "../file.php";
. I tried playing around a bit with the include_path
variable in php.ini
, but nothing seems to be working.
- I'm using Windows 10
- XAMPP's version is 3.2.2
Any idea on what could be causing this, and how to fix it?
Many thanks in advance.
Edit:
The file structure goes like this:
folderA/folderB/folderC
What I try to do is...
- Have a file (
fileA
) infolderA
that includes a file (fileC
) infolderC
- The file (
fileC
) infolderC
includes a file (fileB
) infolderB
Where apache seems to fail is when including fileB
from fileC
.
The code is as follows:
in fileA.php
: include "folderB/folderC/fileC.php";
in fileC.php
: require "../fileB.php";
My include_path
currently looks like this: include_path= ".;D:\xampp\htdocs\"