Windows environment failed to include files
Permalink
I'm trying to run development on windows10 with xampp and I'm having trouble with hardcoded directory separator so I'm not able to include any files
for instance:
Got Error:
Seems that the direcotry separator is not well set for windows enviroment, is there any way to solve this issue?
Thx
for instance:
$this->inc('elements/header.php');
Got Error:
Seems that the direcotry separator is not well set for windows enviroment, is there any way to solve this issue?
Thx
Use the c5 autoloader. don't use include.
I'm assuming this directory does not exist:
concrete/themes/edes
Doesn't it have to look into application/themes/edes? I assume you're running concrete5 5.7 btw. Otherwise it's themes/edes (there is no application folder in 5.6).
Where are you putting this code exactly?
concrete/themes/edes
Doesn't it have to look into application/themes/edes? I assume you're running concrete5 5.7 btw. Otherwise it's themes/edes (there is no application folder in 5.6).
Where are you putting this code exactly?
I put this code into:
C:\xampp\htdocs\edes\application\themes\edes\full.php
anyway I've solved this using:
Now its loading files just fine
C:\xampp\htdocs\edes\application\themes\edes\full.php
anyway I've solved this using:
require('elements/header.php')
Now its loading files just fine
If you compare
C:\xampp\htdocs\concrete/themes/edes/elements/header.php
With
C:\xampp\htdocs\edes\application\themes\edes\full.php
You will see the "edes" is missing in the first one (that's the path that gave you the error). So for some reason, your installation thinks your root website is located under "C:\xampp\htdocs", which it is not. So if you can fix that, you don't have to require or include the file, but use $this->inc() instead like you should.
C:\xampp\htdocs\concrete/themes/edes/elements/header.php
With
C:\xampp\htdocs\edes\application\themes\edes\full.php
You will see the "edes" is missing in the first one (that's the path that gave you the error). So for some reason, your installation thinks your root website is located under "C:\xampp\htdocs", which it is not. So if you can fix that, you don't have to require or include the file, but use $this->inc() instead like you should.