PHP本地和服务器有显示很大差别(阿里云服务器,wordpress)

在说正事之前,我要推荐一个福利:你还在原价购买阿里云、腾讯云、华为云服务器吗?那太亏啦!来这里,新购、升级、续费都打折,能够为您省60%的钱呢!2核4G企业级云服务器低至69元/年,点击进去看看吧>>>),好了下面开始说正事:


<?php
$url=$_GET['Duanshiping_serach'];
header("Content-type: video/mp4");
header("Accept-Ranges: bytes"); 
header("Expires:-1");
header("Cache-Control:no_cache");
header("Pragma:no-cache");
$opts = array(
    'http'=>array(
     'method'=>"GET",
     "timeout"=>20,
     'header'=>"User-Agent: Spider \r\n",
    )
);
$context = stream_context_create($opts);
$html = file_get_contents($url,0,$context,0,100000);
$k=htmlspecialchars($html);
preg_match_all("/(https|ftp)(.)*([a-z0-9\-\.\_])+/",$k,$nav);
$get_dul=$nav[0][2];
$pei=$get_dul;
$true_url=substr_replace($pei,"",38,2);
$header = array(
    "user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $true_url);
curl_setopt($ch, CURLOPT_USERAGENT,'User-Agent: Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1');
curl_setopt($ch, CURLOPT_AUTOREFERER,true);
curl_setopt($ch, CURLOPT_HTTPHEADER,$header);  
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL,true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_MAXREDIRS,5);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,0);
$response = curl_exec($ch);
$r=htmlspecialchars($response);
if ($response  === FALSE) {
  echo "请输入分享链接" . curl_error($ch);
}
else{
  preg_match_all("/(http|https|ftp)(.)*([a-z0-9\-\.\_])+/i",$r,$nav_one);
  $p_sd=implode("",$nav_one[0]);
  $true_url_two=substr_replace($p_sd,"",-22);
  $html_three = file_get_contents($true_url_two);
  echo $html_three;
}
?>

QQ截图20200409193129.png这张是本地的

QQ图片20200409193341.png这张是服务器的

一个可以显示视频一个不能显示视频 服务器的PHP版本是7.3的为什么两个代码相同结果不同?

郑重声明:本站部分内容转载自网络,版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们(QQ/微信153890879)修改或删除,多谢。