PHP での相対パスの手順を理解するのに苦労しています。私はWAMPを使用してローカルホストで作業しており、Googleなどで何時間も費やした後に試したことはすべてエラーです。エラーの範囲は、「ストリームを開くことができませんでした: そのようなファイルまたはディレクトリはありません」からスタック エラーまでです。絶対パスも試しましたが、それでも同じ結果です。どのように進めればよいか途方に暮れているので、本当に助けが必要です。私が試した手順のリストを添付しました。アドバイスがあれば大歓迎です。どうもありがとう
In the admin header file:
<?php require_once('./Connections/connect.php'); ?>
<?php require_once('../../../Connections/connect.php'); ?>
<?php require_once('C:\wamp\www\domain/Connections/connect.php'); ?>
localhost\domain > root > index.php
header.php
footer.php
Connections\connect.php
localhost\domain\admin > index.php
header.php
footer.php
form-inc.php
localhost\domain\admin\cp\users > index.php <--Users control panel in which I need to call
header.php & footer.php from the admin
directory which is where I am having the
problem.
PHP 5.3
WAMP