異なるディレクトリ レベルの 2 つのファイルが同時に同じファイルを呼び出しています。
// index.php
include('./include/same_file.php');
// Webpages/page1.php
include('../include/same_file.php');
// include/same_file.php
include('../template/header.php'); // failed to open on index.php
fopen('../files/text1.txt'); // failed to open on index.php
file('./files/AA.html'); // failed to open on /include/same_file.php
私は何時間も解決策を探してみましたが、dirname(__FILE__)
と$_SERVER[DOCUMENT_ROOT]
解決策を見つけましたが、私のような初心者に詳細な教えを与えていないため、どれも機能しません。