can use inclue outside main directory

Problems with the Windows version of XAMPP, questions, comments, and anything related.

can use inclue outside main directory

Postby nisroc00 » 05. January 2019 01:34

I just installed Xampp portable on a flash disk and I'm having issues using include to call a file from another folder. everything runs just fine if the if everything is in the root directory. Any help with this would be very appreciated.

The errors
Code: Select all
Warning: include(/test/test_file.php): failed to open stream: No such file or directory in E:\xampp\htdocs\test.php on line 3

Warning: include(): Failed opening '/test/test_file.php' for inclusion (include_path='.;E:\xampp\php\includes') in E:\xampp\htdocs\test.php on line 3


main php code
Code: Select all
<?php include "/test/test_file.php"; ?>


Included file code in a folder test
Code: Select all
<?php echo "passed"; ?>
nisroc00
 
Posts: 1
Joined: 05. January 2019 01:24
XAMPP version: 7.3.0
Operating System: windows 10

Re: can use inclue outside main directory

Postby Altrea » 05. January 2019 07:55

Include is a file system operation. A path beginning with a slash is not relative to a Document_Root.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9649
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 29 guests