小编Vir*_*ral的帖子

如何在 HTTP/1.1 中使用 PHP cURL

我的服务器 cURL 版本在进行远程调用时比客户端的版本新,客户端的服务器自动切换到 http/2,有什么办法可以强制使用 curl 和 http/1.1

如何将 cURL HTTP 版本设置为 1.1,我通过在代码中添加以下设置进行了测试,但添加后 curl 停止工作。各种帮助都是可观的。提前致谢。

 curl_setopt($ch, CURLOPT_HTTP_VERSION, '1.1');
 curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
Run Code Online (Sandbox Code Playgroud)

有什么办法可以在 HTTP 1.1 中使用 curl 吗?

我的服务器版本是

PHP 版本 7.2.16

卷曲信息 7.62.0

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

//curl_setopt($ch, CURLOPT_HTTP_VERSION, '1.1');
//curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

curl_setopt($ch, CURLOPT_USERPWD, $user . ':' . $pass);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET …
Run Code Online (Sandbox Code Playgroud)

php curl server-sent-events php-curl

11
推荐指数
1
解决办法
4183
查看次数

如何将 Bitbucket git 克隆到 cPanel Git™ 版本控制中

我已将 git 存入我的 Bitbucket 帐户,并且希望将这些 git 克隆到我的 cPanel Git\xe2\x84\xa2 版本控制中。怎么做?

\n

我可以使用 cPanel 终端拉 git。但我想使用 cPanel Git\xe2\x84\xa2 版本控制进行克隆。

\n

我们希望使用 cPanel Git\xe2\x84\xa2 版本控制来制作 bitbucket git 克隆,以便我们可以从 cPanel git 创建更多分支并对 cPanel 副本进行版本控制。我尝试使用https、git 和 ssh url将 bitbucket git 克隆到 cPanel Git\xe2\x84\xa2 版本控制中,但随后出现以下错误。

\n

来自比特桶

\n
git clone https://<AccountName>@bitbucket.org/<RepositoryName>/<BranchName>.git\n
Run Code Online (Sandbox Code Playgroud)\n

进入cPanel Git\xe2\x84\xa2 版本控制但我收到以下错误。

\n
https://<AccountName>@bitbucket.org/<RepositoryName>/<BranchName>.git\n
Run Code Online (Sandbox Code Playgroud)\n

在此输入图像描述

\n

然后我用 bitbucket 中的 SSH 和 Git 路径进行了测试

\n

对于 SSH 路径,我收到以下错误。

\n
ssh://git@bitbucket.org/<workspace_ID>/<repo_name>.git\n
Run Code Online (Sandbox Code Playgroud)\n

在此输入图像描述

\n

从 bitbucket 中的“克隆”按钮复制的 Fog git …

git bitbucket cpanel

6
推荐指数
1
解决办法
4293
查看次数

Pinterest Rich Pins保存:截断标题和标签

我的固定密码保存按钮存在奇怪的问题。在Pinterest中创建新PIN时,其标题和标签会被截断。

我使用了pinterest开发人员网站中提供的相同OG数据。参考:https : //developers.pinterest.com/docs/rich-pins/articles/吗?

任何建议或帮助,将不胜感激。提前致谢。

我的代码如下。

    <head>

    <meta name="p:domain_verify" content="SITE_VERIFICATION_CODE"/>

    <meta property="og:type" content="article" />
    <meta property="og:title" content="sample title" />
    <meta property="og:description" content="sample content" />
    <meta property="og:url" content="https://www.sample.com/">
    <meta property="og:site_name" content="sample site name" />
    <meta property="og:image" content="https://live.staticflickr.com/7027/6851755809_df5b2051c9_b.jpg"  data-dynamic="true">
    <meta property="article:tag" content="tag1,tag2"  >
    <meta property="article:published_time" content="2018-08-12T00:01:56+00:00" />
    <meta property="article:author" content="Sample author" />
    <meta property="og:keywords" content="keywords1,keywords2"  >

    <script async defer src="//assets.pinterest.com/js/pinit.js"></script>
    </head>

    <body>

    <a target="_blank" style="cursor:pointer;" href="https://www.pinterest.com/pin/create/button/"
   data-pin-do="buttonBookmark"
   data-pin-custom="true">
   SHARE TO PINTEREST
   </a>
  </body>
Run Code Online (Sandbox Code Playgroud)

注意:我已删除上述示例代码中的站点验证代码。参考 https://developers.pinterest.com/docs/rich-pins/articals/吗?参考 https://developers.pinterest.com/docs/rich-pins/reference/

javascript og-meta pinterest

5
推荐指数
1
解决办法
96
查看次数