簡體   English   中英

PHP:導入文件時出錯,無論我使用哪個路徑:absolute /“ dotDOTslash”,我都會收到一條錯誤消息,指出該文件不存在,但確實存在,wtf?

[英]php: error importing file, no matter which path i use: absolute/“dotDOTslash”, i get an error saying the file doesn't exist, but it does exist, wtf?

好的,正如問題所言:我正在將文件包含在文件中,但是我不斷收到“無此文件或目錄”錯誤。 對我來說這真的沒有意義,因為我已經檢查了它們,檢查了它們的權限,並且它們與我可以包含在其他腳本中的相同

請注意:這些包​​含是由另一個文件中包含的文件完成的

即:login.php-包括-check_login.php(產生這些錯誤的文件)

這是我目前的包括:

include('/home/user/public_html/taxnetwork.co.za/main/db/select_all.php');
require_once('input_cleaner.php');
include('/home/user/public_html/taxnetwork.co.za/main/db/insert.php');
require_once('/home/user/public_html/taxnetwork.co.za/main/mail/mailer.php');

這些是我得到的錯誤:

Warning: require_once(./db/insert.php) [function.require-once]: failed to open stream: No such file or directory in /home/user/public_html/taxnetwork.co.za/main/mail/mailer.php on line 2

Fatal error: require_once() [function.require]: Failed opening required './db/insert.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public_html/taxnetwork.co.za/main/mail/mailer.php on line 2

如警告說-你有問題

/home/user/public_html/taxnetwork.co.za/main/mail/mailer.php on line 2

然后查看一下,您將看到require_once(./db/insert.php)可以將其更改為:

require_once('/home/user/public_html/taxnetwork.co.za/main/db/insert.php')

或者 :

require_once(realpath(dirname(__FILE__).'/../../').'/db/insert.php')

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM