2017-10-22 87 views
0

我怎樣才能修復函數「require」在我的PHP內的地址。它的故障排除和錯誤說:要求 - 沒有這樣的文件或目錄

警告:要求(..)無法打開流:沒有這樣的文件或目錄。 the error i get on the browser.

this is my folder structure 文件「db_connection.php」工作完全沒有 - 它具有「app_config.php」 - >必需的,但是當我需要「register_user.php」中的「db_connect.php」我得到這一切的錯誤和地址不匹配..

this is the file tree

register_user.php file contents.

註冊用戶的PHP文件包含

需要「../../../app_configuration/db_connect/db_connection.php」;

的db_connection的內容是

需要「../../app_configurations/definitions/app_config.php」;

db_connection.php

+0

您的路徑引用不正確。請發佈樹的佈局和PHP文件的內容(至少require()/ include()語句) – Wranorn

+0

我編輯了帖子 - 錯誤只發生在我試圖「包含」或「需要」db_connect時。 PHP和錯誤導致回到db_connect文件,當我有db_connect所需的app_config。 –

+0

好吧,我不能使用屏幕截圖,但看看埃德加的答案。 – Wranorn

回答

1

不要使用../../語句。

改爲使用include $_SERVER['DOCUMENT_ROOT'].'/assets/app_configuration/db_connection/db_connection.php'

相關問題