本文介紹了fopen 上的詳細(xì)錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我正在使用 fopen 從文件中讀取數(shù)據(jù)
I'm using fopen to read from a file
$fh = fopen($path, 'r') or die('Could not open file');
現(xiàn)在我不斷收到錯誤無法打開文件.我檢查了文件路徑,甚至將文件的權(quán)限更改為777.有沒有辦法像mysql_error()那樣無法打開文件的詳細(xì)錯誤報告?
Now I contantly get error Could not open file. I checked the file path and even changed the permissions of the file to 777. Is there a way I can get a detailed error report as why the file can't be opened similar to mysql_error()?
推薦答案
打開錯誤報告,或者,在生產(chǎn)環(huán)境中(從 PHP 5.2.0 開始)您也應(yīng)該能夠使用 error_get_last()
.
Turn on error reporting, or, in a production environment (from PHP 5.2.0 onwards) you should also be able to use error_get_last()
.
這篇關(guān)于fopen 上的詳細(xì)錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!