I have a new installation of XAMPP for Windows. When viewing a web page containing PHP include files, the path to the include directory that XAMPP is referencing is not correct.
I have projects in individual directories located in /xampp/htdocs/ (such as /xampp/htdocs/sitename/). I can view all elements of a web page at http://localhost/sitename/ as long as their are no includes.
Example of an include I'm using:
<?php include("_php-inc/myinclude.php"); ?>
Physical location of the include:
C:/xampp/htdocs/sitename/_php-inc/myinclude.php
However, XAMPP is looking here in the shared htdocs:
C:/xampp/htdocs/_php-inc/myinclude.php
-------------
Example error message on web page:
Warning: require_once(C:/xampp/htdocs/_php-inc/myinclude.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\sitename\index.php on line 2
Fatal error: Uncaught Error: Failed opening required 'C:/xampp/htdocs/_php-inc/myinclude.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\sitename\index.php:2 Stack trace: #0 {main} thrown in C:\xampp\htdocs\sitename\index.php on line 2
----------------
Do I need to define a path to each project's directory somewhere in Apache? I've searched this forum and the documentation, but must be missing something.
Thanks for any help!