简短格式:我有一些PHP代码,可将视频从我的网站上传到YouTube。我使用的是由Google提供的常规PHP库google-api-php-client
。我的代码在两台服务器上运行;它可以在一个(https://www.example.com)上运行,但是经过一段良好的工作之后突然停止了在另一个(https://dev.example.com)上运行。
详细信息:据我所知,进行传输的代码是相对标准的:一旦加载了库并且某些变量获得了一些值,我就在做:
$client = new Google_Client();
$client->setClientId($youtube_client_id);
$client->setClientSecret($youtube_client_secret);
$redirect = filter_var('https://example.com/upload-to-youtube', FILTER_SANITIZE_URL);
$client->setRedirectUri($redirect);
$youtube = new Google_YoutubeService($client);
$client->authenticate();
header('Location: ' . $redirect);
对于不工作的服务器,
$client->authenticate
行抛出错误:Google_IOException: HTTP Error: (0) Problem with the SSL CA cert (path? access rights?) in Google_CurlIO->makeRequest() (line 128 of /var/www/html/example/includes/google-api-php-client/src/io/Google_CurlIO.php).
其他可能相关的详细信息:
https://dev.example.com/delete-from-youtube
https://dev.example.com/upload-to-youtube
https://www.example.com/delete-from-youtube
https://www.example.com/upload-to-youtube
(在我看来)证书和对它的访问应该可以(除非证书测试人员错误),所以我不理解投诉来自何处。代码和服务器配置已经有一段时间没有变化了,因此我寻求一个外部解释。 (我知道这些是著名的遗言,但无论如何。)有什么想法吗?谢谢!
最佳答案
潜在的重复问题:
Amazon MarketplaceWebServiceOrders requests suddenly failing, PHP curl giving SSL CA cert error?
我必须重新启动服务器,而不仅仅是重启Apache才能解决问题。
关于php - 带有https的YouTube API:“Google_IOException:使用SSL CA的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26089011/