Include Relative Path Problem
Posted: 07. June 2013 23:30
I just got a new laptop and installed latest version of XAMPP on it. I moved over a web application I am working on from my desktop to my laptop and it isn't work. It appears the "require" I'm doing isn't working. Was there something changed within recent versions of this? Relative paths don't work.
Inside 'includes/include.php' I had it require "config.php"; Since it is in the same directory as the include.php it would work. But now I need to do require "includes/config.php" since the include.php is being required by the index.php. All the locations seem to be relative to the index.php as opposed to where the file is located.
How can I go about fixing this?
- Code: Select all
index.php
includes/config.php
includes/include.php
Inside 'includes/include.php' I had it require "config.php"; Since it is in the same directory as the include.php it would work. But now I need to do require "includes/config.php" since the include.php is being required by the index.php. All the locations seem to be relative to the index.php as opposed to where the file is located.
How can I go about fixing this?