这个问题似乎很常见,我已经浏览了很多与之相关的帖子,但没有任何效果,我快要疯了。奇怪的是,几周前它工作得很好,几个月以来我没有安装任何新东西......
\n\n设置 :
\n\n什么有效:
\n\n什么不起作用:
\n\n安装包
我无法使用 firefox 61.0.1(64 位)访问https://packagist.org/(不安全连接:MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT)
我在作曲家要求时遇到的错误:
\n\n[Composer\\Downloader\\TransportException]\nThe "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:\nerror:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed\nFailed to enable crypto\nfailed to open stream: operation failed \nRun Code Online (Sandbox Code Playgroud)\n\nphp -r “var_dump(openssl_get_cert_locations());” 返回这个:
\n\narray(8) …Run Code Online (Sandbox Code Playgroud) 我正在尝试提取 Soap 响应的 HTTP 状态代码。所以例如我有:
$client = new SoapClient($wsdl);
$client->__setSoapHeaders(
new SoapHeader(
$nameSpace,
'Security',
$secHeaderValue,
true
)
);
// The actual call
$response = $client->Complete($paramswebservice)
Run Code Online (Sandbox Code Playgroud)
所以现在我得到了响应头,这样:
$responseHeaders = $client->__getLastResponseHeaders();
var_dump($responseHeaders);
Run Code Online (Sandbox Code Playgroud)
这是 vardump 的结果:以这种方式格式化的字符串(网络浏览器 - 页面源代码)
我现在正在做的是提取 http 状态代码“200”:
/**
* Returns the HTTP Status code of $response
* @param string $response
* @return string
*/
function extract_response_http_code($response) {
$tmp = explode('\n', $response);
$array = explode(' ', $tmp[0]);
return $array[1];
}
Run Code Online (Sandbox Code Playgroud)
我真的不喜欢这个解决方案。我想要一个更强大/一致的。有什么建议 ?
编辑 1
正如评论中所问:
HTTP/1.1 200 正常 缓存控制:私有,最大年龄=0 内容长度:1315 …