So recently I decided to move my php code that was at the top of every page, and exactly the same to it's own php file. First thing I did before trying a require_once() on it was to make sure php could read the file so I did
<?php
if(file_exists('Backend.php')) {
echo 'File does exist';
}
?>
And it echo'd out that the file exists perfectly fine. Now whenever i try:
<?php
require('Backend.php') or die('Could not load Backend.');
?>
I get the error:
'Warning: require(1): failed to open stream: No such file or directory in
C:\Users\Owner\Dropbox\PotateOS\index.php on line 2
Fatal error: require(): Failed opening required '1'(include_path='.;C:\xampp\php\PEAR;C:\Users\Owner\Dropbox\PotateOS') in C:\Users\Owner\Dropbox\PotateOS\index.php on line 2
Note I am using(XAMPP). Things I have tried:
Adding the path of the files to php.ini's include_path
Checking the filename to make sure it doesn't have any strange charectars
Using this as the file path:
<?php
require($_SERVER['DOCUMENT_ROOT'] . 'Backend.php') or die('Could not load');
?>
(Note both the page i'm trying to access backend from, and backend are in the root directory)