本文介绍了致命错误:消息为"SSL证书问题:无法获取本地发行者证书"的未捕获异常"Parse \ ParseException"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我第一次使用parse.com php SDK并尝试执行以下代码
This is the first time I use parse.com php SDK and I try to execute the following code
<?php require '../autoload.php';
use Parse\ParseObject;
use Parse\ParseClient;
ParseClient::initialize( "Zsr...", "BzM..", "D..." );
$gameScore = new ParseObject("GameScore");
$gameScore->set("score", 1337);
$gameScore->set("playerName", "Sean Plott");
$gameScore->set("cheatMode", false);
try {
$gameScore->save();
echo 'New object created with objectId: ' . $gameScore->getObjectId();
} catch (ParseException $ex) {
// Execute any logic that should take place if the save fails.
// error is a ParseException object with an error code and message.
echo 'Failed to create new object, with error message: ' + $ex->getMessage();
}
?>
但是我得到了这个错误
Fatal error: Uncaught exception 'Parse\ParseException' with message 'SSL certificate problem: unable to get local issuer certificate' in /opt/lampp/htdocs/parse/src/Parse/ParseClient.php:250 Stack trace: #0 /opt/lampp/htdocs/parse/src/Parse/ParseObject.php(925): Parse\ParseClient::_request('POST', '/1/classes/Game...', NULL, '{"score":1337,"...', false) #1 /opt/lampp/htdocs/parse/src/Parse/ParseObject.php(836): Parse\ParseObject::deepSave(Object(Parse\ParseObject), false) #2 /opt/lampp/htdocs/parse/src/hola.php(11): Parse\ParseObject->save() #3 {main} thrown in /opt/lampp/htdocs/parse/src/Parse/ParseClient.php on line 250
代码是教程代码,我没有改变任何人知道有什么问题吗?
The code it's the tutorial code, iI haven't changed anything anyone knows what's the problem?
推荐答案
我也遇到了同样的问题.现在,我决定使用其他一些论坛的答案.
I am also getting same issue. Now I resolve using some other forums answer.
打开您的ParseClient.php并找到:
Open your ParseClient.php and find:
curl_init();
然后在该行添加以下内容:
And after that add line add:
curl_setopt($rest, CURLOPT_SSL_VERIFYPEER, false);
它将起作用.
这篇关于致命错误:消息为"SSL证书问题:无法获取本地发行者证书"的未捕获异常"Parse \ ParseException"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!