国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

這篇具有很好參考價值的文章主要介紹了failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

PHP Warning 'yii\base\ErrorException' with message 'file_get_contents(https://img12.360buyimg.com/n5/s1200x800_jfs/t1/69307/10/5911/292411/5d3e610cEce4e6f5a/b69fbf56874af00d.jpg): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

上面問題很多種處理方案;比如使用curl等可以參考其他使用產(chǎn)景

定時任務腳本中存在一個批量遍歷去請求圖片的接口;特別是腳本中,一定的要兼容好,比如try等文章來源地址http://www.zghlxwxcb.cn/news/detail-743959.html

 /**
     * Created by XX
     * description: 批量同步支付寶商品文件
     */
    public function actionSyncAlipayGoodsFile()
    {
        set_time_limit(0);
        date_default_timezone_set("PRC");
        $store_list = array_column(Store::find()->where(['is_delete' => 0, 'is_recycle' => 0])->select(['id'])->asArray()->all(), 'id');
        if (empty($store_list)) {
            return;
        }
        //遍歷商戶
        foreach ($store_list as $store_id) {
            $key = CacheKeyEnum::ALIPAY_GOODS_FILE.$store_id;
            $redis = \Yii::$app->redis;
            $len = $redis->llen($key);
            if(!$len){
                continue;
            }
            $successCount = $errorCount = 0;
            for ($i=1; $i<=$len; $i++) {
                $good = $redis->rpop($key);
                if($good){
                    $good = json_decode($good,true);
                    if($good['cover_pic']){

                        //避免圖片不存在導致腳本中斷問題
                        if(!@fopen($good['cover_pic'], 'r' )){
                            continue;
                        }
                        $file_content = saveAlipayTempImage(file_get_contents($good['cover_pic']));
                        $config = MpConfig::get($store_id);
                        //避免未知原因?qū)嵗е缕渌虘羰苡绊?                        try {
                            $aop = $config->getClient();
                        } catch (\InvalidArgumentException $ex) {
                            continue;
                        }

                        try {
                            $request = AlipayRequestFactory::create('alipay.merchant.item.file.upload', [
                                'scene'=> 'SYNC_ORDER',
                                'file_content'=> '@'.$file_content
                            ]);
                            $response = $aop->execute($request);
                            $data = $response->getData();
                            if(isset($data['material_id']) && $data['material_id']){
                                \app\models\Goods::updateAll(['material_id'=>$data['material_id'],'material_key'=>$data['material_key'],'material_status'=>1],['id'=>$good['id']]);
                                $successCount+=1;
                                \Yii::$app->redis->incr(CacheKeyEnum::ALIPAY_GOODS_FILE_SUCCESS.$store_id);
                            }else{
                                \app\models\Goods::updateAll(['material_reason'=>$data['sub_msg'],'material_status'=>2],['id'=>$good['id']]);
                                $errorCount+=1;
                                \Yii::$app->redis->incr(CacheKeyEnum::ALIPAY_GOODS_FILE_FAIL.$store_id);
                            }
                        }catch (AlipayException $ex) {
                            $errorCount+=1;
                            \Yii::$app->redis->incr(CacheKeyEnum::ALIPAY_GOODS_FILE_FAIL.$store_id);
                            \Yii::error(['data' => $ex->getMessage()], '支付寶訂單中心:商品文件上傳失敗');
                        }
                    }
                }
            }
            \Yii::$app->redis->del(CacheKeyEnum::ALIPAY_GOODS_FILE.$store_id.'TotalCount');
        }
        echo 'batch sync alipay goods file success'. "\n";
    }

到了這里,關于failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • 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站點經(jīng)??赡軙龅降膯栴},361源碼做了個總結(jié),希望

    2024年02月09日
    瀏覽(24)
  • 嚴重: Failed to initialize connector [Connector[HTTP/1.1-8080]] 端口號沖突

    嚴重: Failed to initialize connector [Connector[HTTP/1.1-8080]] 端口號沖突

    嚴重: Failed to initialize connector [Connector[HTTP/1.1-8080]] 原因 :這是由于8080端口被占用導致 解決方法: 1、首先按下鍵盤win+R ,在其中輸入“cmd”并回車。 2、打開后輸入“netstat -ano”命令查看所有端口被占用情況,找到被占用端口的PID碼。 3、按Crtl + Alt + Del 鍵打開任務管理器,

    2024年02月13日
    瀏覽(27)
  • 關于android11,12權限問題Unable to decode stream: open failed: EACCES (Permission denied)

    第一次發(fā)博客 這個問題是我在制作一款app時發(fā)現(xiàn)的,我本來想在一個textview中加入一個圖片 但是總是報錯 E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20230129_123518.jpg: open failed: EACCES (Permission denied) 我在瀏覽了大多數(shù)關于這個問題的討論和

    2024年02月07日
    瀏覽(86)
  • GET http://localhost:8080/xx/xx 404 (Not Found) 和Uncaught (in promise) Error: failed報錯的原因

    GET http://localhost:8080/xx/xx 404 (Not Found) 和Uncaught (in promise) Error: failed報錯的原因

    這兩天,我遇見了一個很離譜的錯誤,我找不到原因發(fā)生在哪里,但是知道代理服務器出錯了,代理了后端給的接口,但是,卻向本地發(fā)起請求,快把我整崩潰了 GET http://localhost:8080/xx/xx 404 (Not Found) 和Uncaught (in promise) Error: failed 開啟代理后,發(fā)起請求,因為后端給的路徑?jīng)]有

    2024年02月07日
    瀏覽(25)
  • Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop102:10000: Failed to open..

    Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop102:10000: Failed to open..

    在hive目錄下使用beeline命令: ?具體的報錯信息如下所示: 22/04/10 01:13:24 [main]: WARN jdbc.HiveConnection: Failed to connect to hadoop102:10000 Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop102:10000: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hado

    2024年02月11日
    瀏覽(29)
  • 前端JQuery引入不成功報錯Failed to load resource: the server responded with a status of 404 (Not Found);

    路徑?jīng)]有問題( 采用相對路徑 , 兩種打開文件夾方式都是看到Jquery,VScode里面,不排除這個存在理解錯誤) ,但VScode打開文件夾不一樣,引入的JQuery放在其他文件夾時,報錯 Failed to load resource: the server responded with a status of 404 (Not Found); Refused to execute script from \\\'http://127.0.0.1:55

    2024年02月13日
    瀏覽(23)
  • Could not proxy request /captchaImage from localhost to http://localhost:8080/.

    Could not proxy request /captchaImage from localhost to http://localhost:8080/.

    項目場景:配置若依環(huán)境前端通過 run npm dev 啟動報500 根據(jù)報錯分析,無法將請求,/路徑,從本地主機代理到http://本地主機:8080/ ? 我們可以看到前端配置的端口號80 地址就是本機沒有問題,排除前端問題 那就是后端配置文件映射路徑有問題 原來配置文件端口是8125,改成

    2024年02月16日
    瀏覽(22)
  • ? error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

    使用Git的時候今天突然遇到了問題 今天突然使用Mac報錯: Git遇到一個問題,如標題 1.搜羅一大堆最終指向這是http2本身的bug。 1.(推薦)直接換掉Git的http版本 git config --global http.version HTTP/1.1 2.更改Git的http克隆為ssh,使用ssh進行提交和拉取代碼 — 使用ssh連接Git操作指南(…更新

    2024年02月04日
    瀏覽(22)
  • 爬蟲requests使用代理報錯Your proxy appears to only use HTTP and not HTTPS...

    python版本:3.9.4 requests版本:2.28.2 詳細報錯如下 代理使用如下: 使用如下代理設置,報錯得到解決 總結(jié):由于之前使用的是python3.6.8版本,代理設置為’https’: \\\'https://xxxx’可以正常使用,而升級到python3.9.4則出現(xiàn)了上述問題。建議代理的使用統(tǒng)一為 ‘https’: ‘http://xxxx’

    2024年02月15日
    瀏覽(33)
  • unable to access ‘https://github.com/***/‘: HTTP/2 stream 1 was not closed cleanly before end

    unable to access ‘https://github.com/***/‘: HTTP/2 stream 1 was not closed cleanly before end

    錯誤提示: 錯誤原因: 當前git的網(wǎng)絡協(xié)議和github要求的不一致; 解決方法: 執(zhí)行上面指令后: .gitconfig中添加了http/1.1的協(xié)議,再提交試試;

    2024年02月03日
    瀏覽(20)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包