php include 報錯怎麼辦
Mar 19, 2021 am 10:33 AM
php
php include報錯的解決方法:1、檢查include檔案的位置是否正確;2、偵測被包含的檔案讀取權限是否開啟;3、偵測被包含的檔案路徑上的每個目錄的x權限是否開啟。
本文操作環境:windows7系統、PHP7.1版,DELL G3電腦
php腳本中include檔案報錯解決方法
經常在php頁面中利用include, require, require_once包含了一些其他位置的頁面時,會出現錯誤,例如沒有發現次頁面,或者權限不允許等,可以根據以下方法來排除
1. 出現「未找到檔案「類似的錯誤時候,檢查include檔案的位置是否正確,以下引用php手冊頁面的原話:
以下為引用的內容:
Files for including are first looked in include_path relative to the current working directory and then in the directory of the current script. E.g. if your include_path is libraries, current working directory is /www/, you included include/a.php and there is include "b.php" in that file, b.php is first looked in /www/libraries/ and then in /www/include/. If filename begins with ./ or ../, it is looked only in include_path relative to the current working directory.
登入後複製
2. 當出現permission deny 類似錯誤的時候,按以下方法排除
a) 檢測被包含的文件讀取權限是否開啟
b) 檢測被包含的檔案路徑上的每個目錄的x權限是否打開,該權限決定了目錄是否能被瀏覽。
【推薦:PHP影片教學】
#以上是php include 報錯怎麼辦的詳細內容。更多資訊請關注PHP中文網其他相關文章!
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱門文章
兩個點博物館:邦格荒地地點指南
4 週前
By 尊渡假赌尊渡假赌尊渡假赌
擊敗分裂小說需要多長時間?
3 週前
By DDD
倉庫:如何復興隊友
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
公眾號網頁更新緩存難題:如何避免版本更新後舊緩存影響用戶體驗?
3 週前
By 王林

熱門文章
兩個點博物館:邦格荒地地點指南
4 週前
By 尊渡假赌尊渡假赌尊渡假赌
擊敗分裂小說需要多長時間?
3 週前
By DDD
倉庫:如何復興隊友
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
公眾號網頁更新緩存難題:如何避免版本更新後舊緩存影響用戶體驗?
3 週前
By 王林

熱門文章標籤

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

適用於 Ubuntu 和 Debian 的 PHP 8.4 安裝和升級指南

如何設定 Visual Studio Code (VS Code) 進行 PHP 開發
