I’m facing a problem with include files in my php code.
i’m using my code like local code but it’s give me this erreur:
Warning : include(includes/db.php): failed to open stream: No such file or directory in /storage/ssd5/990/15014990/public_html/functions/functions.php on line 3
Warning : include(includes/db.php): failed to open stream: No such file or directory in /storage/ssd5/990/15014990/public_html/functions/functions.php on line 3
Warning : include(): Failed opening ‘includes/db.php’ for inclusion (include_path=’.:/usr/share/pear:/usr/share/php’) in /storage/ssd5/990/15014990/public_html/functions/functions.php on line 3
I’m guessing you’ve coded that in a Windows environment. Windows OS manages paths in a different way than UNIX does (I believe that’s up to php configuration as well). In your case the path you’re using should be ../includes/db.php because you’re searching the file one directory above within directories tree, relative to functions.php file location.
Famous frameworks prefer to use fixed paths via magical globals such as __DIR__ or via getcwd() to make sure the lookup is compatible on all platforms.