沃梦达 / 编程问答 / php问题 / 正文

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

php parse sdk -gt; hello world error(php解析sdk-你好世界错误)

本文介绍了php解析sdk->你好世界错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Php Parse Sdk

我的代码:

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

use ParseParseClient;

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

use ParseParseObject;

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

?>

和错误:

Fatal error: Uncaught exception 'ParseParseException' with message 'SSL certificate problem: unable to get local issuer certificate' in C:xampphtdocsparsesdkvendorparsephp-sdksrcParseParseClient.php:250 
Stack trace: #0 C:xampphtdocsparsesdkvendorparsephp-sdksrcParseParseObject.php(915): ParseParseClient::_request('POST', '/1/classes/Test...', NULL, '{"foo":"bar"}') 
#1 C:xampphtdocsparsesdkvendorparsephp-sdksrcParseParseObject.php(828): ParseParseObject::deepSave(Object(ParseParseObject)) 
#2 C:xampphtdocsparsesdkindex.php(12): ParseParseObject->save() 
#3 {main} thrown in  C:xampphtdocsparsesdkvendorparsephp-sdksrcParseParseClient.php on line 250

推荐答案

选项1:

您可以关注网址http://curl.haxx.se/ca/cacert.pem 下载 cacert.pem 文件.然后去php.ini设置curl.cainfo = "c:/cacert.pem".

You can follow the url http://curl.haxx.se/ca/cacert.pem to download cacert.pem file. Then go to php.ini set curl.cainfo = "c:/cacert.pem".

选项 2:

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

try to find the code curl_setopt($c, CURLOPT_URL, $url); in your project then add this code curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, TRUE); before.

这篇关于php解析sdk->你好世界错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:php解析sdk->你好世界错误

基础教程推荐