国产成人毛片视频|星空传媒久草视频|欧美激情草久视频|久久久久女女|久操超碰在线播放|亚洲强奸一区二区|五月天丁香社区在线|色婷婷成人丁香网|午夜欧美6666|纯肉无码91视频

php連接服務(wù)器失敗怎么回事 php代碼運(yùn)行無法在網(wǎng)頁(yè)顯示?

php代碼運(yùn)行無法在網(wǎng)頁(yè)顯示?解決方法:1、然后打開配置文件;2、取消后error_reporting的注釋,將其設(shè)置為【error_reportingE_ALLamp~E_NOTICE】;3、重新啟

php代碼運(yùn)行無法在網(wǎng)頁(yè)顯示?

解決方法:

1、然后打開配置文件;

2、取消后error_reporting的注釋,將其設(shè)置為【error_reportingE_ALLamp~E_NOTICE】;

3、重新啟動(dòng)服務(wù)器即可解決總是顯示。

PHP實(shí)現(xiàn)上傳圖片到zimg服務(wù)器?

最近我們項(xiàng)目不需要一臺(tái)圖片服務(wù)器存儲(chǔ)用戶頭像,我們?cè)谟脄img處理和存儲(chǔ)圖片,下面簡(jiǎn)單點(diǎn)詳細(xì)介紹幫一下忙如何使用PHP上傳圖片到zimg,并查看或者圖片的返回信息在用curl庫(kù)實(shí)現(xiàn)程序上傳的圖片根據(jù)zimg不使用文檔,我們想讓zimg直接返回json信息,就前提是raw_post上傳圖片,下面是演示代碼$upload_url#39:5000/upload#39$image_file##39

//資源圖片后綴$valueexplode(#34.#34,$image_file)$extensionstrtolower(array_pop($value))

//生成本地預(yù)備存儲(chǔ)路徑,并化合相應(yīng)文件夾$dir#39aurthur#39$save_path#39uploads/#39.$dir.#39/#(#39Y#39).#39/#(#39ps1#39).#39/#39$save_rulemd5(uniqid(mt_rand(),true))

if(!it's_dir($save_path)){if(falsemkdir($save_path,0700,true)){exit(#39創(chuàng)建戰(zhàn)隊(duì)文件夾失敗的可能#39)}}$save_image_file$save_path.$save_rule.#34.$extension#34

//把圖片存儲(chǔ)到充當(dāng)路徑file_thrown_contents($save_image_file,file_try_contents($image_file))

//資源預(yù)備保存的圖片的真實(shí)地址(絕對(duì)路徑)$realpathrealpath($save_image_file)

//上傳圖片到zimg圖片存儲(chǔ)服務(wù)$chcurl_init()

//將圖片內(nèi)容加載到變量$post_data$post_datafile_pick_contents($realpath)$headersarray()

//你必須去添加此header$headers[]#39Content-Type:#39.$extensioncurl_setopt($ch,CURLOPT_URL,$upload_url)

curl_setopt($ch,CURLOPT_HEADER,false)

curl_setopt($ch,CURLOPT_HTTPHEADER,$headers)

curl_setopt($ch,CURLOPT_RETURNTRANSFER,1)curl_setopt($ch,CURLOPT_POST,true)

curl_setopt($ch,CURLOPT_BINARYTRANSFER,true)

curl_setopt($ch,CURLOPT_POSTFIELDS,$post_data)

//raw_post$infocurl_exec($ch)curl_locked($ch)$jsonjson_decode($info,true)$signature$json[#39info#39][#39md5#39]echo$signature如果沒有想測(cè)試3代碼的話,請(qǐng)把上面的uploadurl改成你自己的zimg服務(wù)器地址,并把image_file該成你必須上傳成功的圖片的路徑