Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
445 views
in Technique[技术] by (71.8m points)

php parse sdk -> hello world error

I am using the "Hello World" of Php Parse Sdk

My code:

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

use ParseParseClient;

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

use ParseParseObject;

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

?>

and the error:

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

option 1:

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".

option 2:

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...