<noframes id="bhrfl"><address id="bhrfl"></address>

    <address id="bhrfl"></address>

    <noframes id="bhrfl"><address id="bhrfl"><th id="bhrfl"></th></address>

    <form id="bhrfl"><th id="bhrfl"><progress id="bhrfl"></progress></th></form>

    <em id="bhrfl"><span id="bhrfl"></span></em>

    全部
    常見問題
    產品動態
    精選推薦

    failed to open stream: No such file or directory問題解決大全

    管理 管理 編輯 刪除

    這篇文章主要為大家詳細介紹了failed to open stream: No such file or directory問題解決大全,具有一定的參考價值,感興趣的小伙伴們可以參考一下,有需要的朋友可以收藏方便以后借鑒。

    failed to open stream: No such file or directory是PHP站點經常可能會遇到的問題,361源碼做了個總結,希望能幫助到一些遇到這個問題的朋友們。

    案例一

    (failed to open stream: No such file or directory)在IIS下PHP環境配置的目錄權限導致出錯的問題

    原因及解決方法

    配置環境為 IIS + php

    如果確認你的程序在其他環境下下可以正常運行而唯獨在Win 下的 IIS 出現類似如下的錯誤:

    Warning: main(./Config.php): failed to open stream: No such file or directory in D:/wwwroot/Demo/Config.php on line 13

    Fatal error: main(): Failed opening required './Config.php' (include_path='.;c:/php4/pear') in D:/wwwroot/Core/Config.php on line 13

    這個問題主要是 由于Win NTFS盤下去除了everyone 權限引起的, 在安全權限中加個 Internet 來賓賬號就解決了.

    操作步驟: D盤 -> 屬性 -> 安全 -> 添加 用戶 IUSR_XXXXX OK

    案例二

    問題就是:

    Warning: require_once(../lib/DBUtil.class.php) [function.require-once]: failed to open stream: No such file or directory in E:/phppro/dxh/service/ExpertService.class.php on line 2

    Fatal error: require_once() [function.require]: Failed opening required '../lib/DBUtil.class.php' (include_path='.;C:/php5/pear') in E:/phppro/dxh/service/ExpertService.class.php on line 2

    解決方法

    1. 在require時加上dirname(__FILE__),像這樣: require_once(dirname(__FILE__)."/../lib/DBUtil.class.php");
    2. 如下理解 require_once實例:
    <?php
     //如果b.php被其他目錄里的a.php文件require 或者 include 去引用的話 require_once("./c.php"); 
     //實際上調用的是a.php目錄下的c.php require_once(dirname(__FILE__)."/c.php"); 
     //實際上調用的是b.php目錄下的c.php require_once("c.php"); 
     //實際上調用的是b.php目錄下的c.php
    ?>

    案例三:

    運行php網站,出錯,內容如下:

    Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

    Fatal error: Unknown: Failed opening required 'E:/php/www/mrsoft/注冊登錄模塊/index.php' (include_path='.;C:/php5/pear') in Unknown on line 0

    解決方法:

    apache不能解析上圖中“注冊登錄模塊”的中文URL,把它換成英文路徑即可。

    總結:

    關于failed to open stream: No such file or directory出現的問題,大體就分為這3大類型。如果你也遇到了這樣的報錯,你可以仔細比對屬于哪個類型的錯誤。根據上面的提示和解決辦法處理,相信很快就能解決問題。


    請登錄后查看

    CRMEB-慕白寒窗雪 最后編輯于2023-05-17 18:32:17

    快捷回復
    回復
    回復
    回復({{post_count}}) {{!is_user ? '我的回復' :'全部回復'}}
    排序 默認正序 回復倒序 點贊倒序

    {{item.user_info.nickname ? item.user_info.nickname : item.user_name}} LV.{{ item.user_info.bbs_level }}

    作者 管理員 企業

    {{item.floor}}# 同步到gitee 已同步到gitee {{item.is_suggest == 1? '取消推薦': '推薦'}}
    {{item.is_suggest == 1? '取消推薦': '推薦'}}
    沙發 板凳 地板 {{item.floor}}#
    {{item.user_info.title || '暫無簡介'}}
    附件

    {{itemf.name}}

    {{item.created_at}}  {{item.ip_address}}
    打賞
    已打賞¥{{item.reward_price}}
    {{item.like_count}}
    {{item.showReply ? '取消回復' : '回復'}}
    刪除
    回復
    回復

    {{itemc.user_info.nickname}}

    {{itemc.user_name}}

    回復 {{itemc.comment_user_info.nickname}}

    附件

    {{itemf.name}}

    {{itemc.created_at}}
    打賞
    已打賞¥{{itemc.reward_price}}
    {{itemc.like_count}}
    {{itemc.showReply ? '取消回復' : '回復'}}
    刪除
    回復
    回復
    查看更多
    打賞
    已打賞¥{{reward_price}}
    5528
    {{like_count}}
    {{collect_count}}
    添加回復 ({{post_count}})

    相關推薦

    快速安全登錄

    使用微信掃碼登錄
    {{item.label}} 加精
    {{item.label}} {{item.label}} 板塊推薦 常見問題 產品動態 精選推薦 首頁頭條 首頁動態 首頁推薦
    取 消 確 定
    回復
    回復
    問題:
    問題自動獲取的帖子內容,不準確時需要手動修改. [獲取答案]
    答案:
    提交
    bug 需求 取 消 確 定
    打賞金額
    當前余額:¥{{rewardUserInfo.reward_price}}
    {{item.price}}元
    請輸入 0.1-{{reward_max_price}} 范圍內的數值
    打賞成功
    ¥{{price}}
    完成 確認打賞

    微信登錄/注冊

    切換手機號登錄

    {{ bind_phone ? '綁定手機' : '手機登錄'}}

    {{codeText}}
    切換微信登錄/注冊
    暫不綁定
    亚洲欧美字幕
    CRMEB客服

    CRMEB咨詢熱線 咨詢熱線

    400-8888-794

    微信掃碼咨詢

    CRMEB開源商城下載 源碼下載 CRMEB幫助文檔 幫助文檔
    返回頂部 返回頂部
    CRMEB客服