five-server-vscode icon indicating copy to clipboard operation
five-server-vscode copied to clipboard

Can't include file outside of a subfolder

Open Lunyyx opened this issue 2 years ago • 1 comments

Hello My structure looks like this:

/tutorials/windows.php
/includes/navbar.php
/index.php

When I'm on the windows.php file, I try to include the navbar.php with:

include('../includes/navbar/navbar.php');

But, it gives me an error because it can't find the file

I tried with an apache server, and it's working fine

Lunyyx avatar Feb 15 '23 23:02 Lunyyx

Hi @Lunyyx

Try with __DIR__, example: <? php include __DIR__ . "/../shared/navbar.html"; ?>

kyubson avatar Apr 05 '23 14:04 kyubson