php解析sdk – >你好世界错误

我正在使用Php Parse Sdk的“Hello World”

我的代码:

<?php 
require 'vendor/autoload.php';

use Parse\ParseClient;

ParseClient::initialize('WVqz27oWBfP2weewrfeweKAlVWymjltMGqi9h', 'jgtaXI1Nrim1B4fdnewewewef3iNXgER8y', 'JD8B6dNL9FleweewewhjvvwZwIlc800');

use Parse\ParseObject;

$testObject = ParseObject::create("TestObject");
$testObject->set("foo", "bar");
$testObject->save();

?>

和错误:

Fatal error: Uncaught exception 'Parse\ParseException' with message 'SSL certificate problem: unable to get local issuer certificate' in C:\xampp\htdocs\parsesdk\vendor\parse\php-sdk\src\Parse\ParseClient.php:250 
Stack trace: #0 C:\xampp\htdocs\parsesdk\vendor\parse\php-sdk\src\Parse\ParseObject.php(915): Parse\ParseClient::_request('POST', '/1/classes/Test...', NULL, '{"foo":"bar"}') 
#1 C:\xampp\htdocs\parsesdk\vendor\parse\php-sdk\src\Parse\ParseObject.php(828): Parse\ParseObject::deepSave(Object(Parse\ParseObject)) 
#2 C:\xampp\htdocs\parsesdk\index.php(12): Parse\ParseObject->save() 
#3 {main} thrown in  C:\xampp\htdocs\parsesdk\vendor\parse\php-sdk\src\Parse\ParseClient.php on line 250
最佳答案
选项1:

您可以按照网址http://curl.haxx.se/ca/cacert.pem下载cacert.pem文件.然后转到php.ini set curl.cainfo =“c:/cacert.pem”.

选项2:

尝试找到代码curl_setopt($c,CURLOPT_URL,$url);在你的项目中然后添加这个代码curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,TRUE);之前.

转载注明原文:php解析sdk – >你好世界错误 - 代码日志