解決php腳本中include文件報錯的方法_PHP教程
推薦:PHP實例 PHP實現(xiàn)定時生成HTML網(wǎng)站首頁在開始之前還是提一下三個函數(shù)吧:ob_start()、ob_end_clean()、ob_get_contents() ob_start():是打開緩沖區(qū)的,就是要把您需要生成的靜態(tài)文件的內(nèi)容緩存在這里; ob_get_c
經(jīng)常當(dāng)php頁面中利用include, require, require_once包含了一些其他位置的頁面時,會出現(xiàn)錯誤,比如沒有發(fā)現(xiàn)次頁面,或者權(quán)限不允許等,可以根據(jù)以下方法來排除
1. 出現(xiàn)“未找到文件“類似的錯誤時候,檢查include文件的位置是否正確,下面引用php手冊頁面的原話:
| 以下為引用的內(nèi)容:
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. 當(dāng)出現(xiàn)permission deny 類似錯誤的時候,按以下方法排除
a) 檢測被包含的文件讀權(quán)限是否打開
b) 檢測被包含的文件路徑上的每個目錄的x權(quán)限是否打開,該權(quán)限決定了目錄能否被瀏覽。
分享:如何用PHP程序?qū)W(wǎng)頁表單進(jìn)行處理PHP _GET 和 _POST變量是用來獲取表單中的信息的,比如用戶輸入的信息。 PHP表單操作 在我們處理HTML表單和PHP表單時,我們要記住的重要一點是:HTML頁面中的任何一個表單元素都可以自
- PHPNOW安裝Memcached擴(kuò)展方法詳解
- php記錄頁面代碼執(zhí)行時間
- PHP中獎概率的抽獎算法程序代碼
- apache設(shè)置靜態(tài)文件緩存方法介紹
- php對圖像的各種處理函數(shù)代碼小結(jié)
- PHP 關(guān)于訪問控制的和運算符優(yōu)先級介紹
- 關(guān)于PHP語言構(gòu)造器介紹
- php/js獲取客戶端mac地址的實現(xiàn)代碼
- php5.5新數(shù)組函數(shù)array_column使用
- PHP preg_match的匹配多國語言的技巧
- php 中序列化和json使用介紹
- php采集文章中的圖片獲取替換到本地
- 相關(guān)鏈接:
- 教程說明:
PHP教程-解決php腳本中include文件報錯的方法
。