Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如果url中使用https,则不显示动态网页内容_Php_Ssl_Ssl Certificate - Fatal编程技术网

Php 如果url中使用https,则不显示动态网页内容

Php 如果url中使用https,则不显示动态网页内容,php,ssl,ssl-certificate,Php,Ssl,Ssl Certificate,我们已经为我们的网站部署了一个新的SSL证书。 我们注意到,如果前缀为“https”,则不会加载动态网页(来自mysql数据库的数据),同时,如果我们打开没有https的网页,则页面会正确加载(来自mysql数据库的数据会被提取和显示) 可能是什么问题?问题是无法加载jquery库,因为它使用http而不是https,所以客户端代码都无法工作 来自firebug: Blocked loading mixed active content "http://ajax.googleapis.com/a

我们已经为我们的网站部署了一个新的SSL证书。 我们注意到,如果前缀为“https”,则不会加载动态网页(来自mysql数据库的数据),同时,如果我们打开没有https的网页,则页面会正确加载(来自mysql数据库的数据会被提取和显示)


可能是什么问题?

问题是无法加载jquery库,因为它使用http而不是https,所以客户端代码都无法工作

来自firebug:

Blocked loading mixed active content "http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"
您应该使用https加载jquery,如下所示:

https://ajax.googleapis.com/ajax/libs/jquery/1.4.3
或者像这样:

//ajax.googleapis.com/ajax/libs/jquery/1.4.3
根据它访问的页面的协议,它将通过http或https加载库

通常,一旦切换到https,您应该通过https加载所有脚本,否则它们将被视为安全漏洞而被阻止


您可以在这里了解更多信息:

扩展@NeilMasters语句:使用
//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
,因为web浏览器会将其默认为访问网页时使用的协议
//ajax.googleapis.com/ajax/libs/jquery/1.4.3