I have a Home folder with two subfolders like
+Home +include - membersite_config.php +iDiscover -index.php
in index.php I added a require_once script to access memberite_config.php
<?PHP require_once($_SERVER['DOCUMENT_ROOT'].'/include/membersite_config.php'); ?>
I get the following error: Warning: require_once (./include/fg_membersite.php): could not open the stream: there is no such file or directory in D: \ Home \ include \ membersite_config.php on line 2
Fatal error: require_once (): opening failure required "./include/fg_membersite.php" (include_path = '; C: \ php \ pear') in D: \ Home \ include \ membersite_config.php on line 2
The error says: There is no such file or directory as long as the path "D: \ Home \ include \ membersite_config.php" is correct. When I move index.php to the root, the page works well.
I also tried using the following code as described here , but it gives the same error
<?PHP define('ROOT', 'D:Home\\'); require_once(ROOT ."/include/membersite_config.php"); ?>
Edit:
I also tried require_once ("../include / membersite _config.php"); And he gives the same error
Thank you in advance
source share