Fatal error: Throw "Parse \ ParseException" with message in parse sdk

I used the following code to get db data:

require 'autoload.php';
$app_id='AAAAA';
$rest_key='XXXXX';
$master_key='RRRRR';

use Parse\ParseObject;
use Parse\ParseQuery;
use Parse\ParseACL;
use Parse\ParsePush;
use Parse\ParseUser;
use Parse\ParseInstallation;
use Parse\ParseException;
use Parse\ParseClient;
use Parse\ParseAnalytics;
use Parse\ParseFile;
use Parse\ParseCloud;
ParseClient::initialize( $app_id, $rest_key, $master_key );
$object = new ParseQuery("Schools");
$playername = $object->get("playername");

      

I have a class "Schools" in my parse db account with some data. I am trying to get the value "playername" but I got the following error:

Fatal error: Uncaught exception 'Parse\ParseException' with message 'SSL certificate problem: unable to get local issuer certificate' in C:\xampp\htdocs\planlet\src\Parse\ParseClient.php:250 Stack trace: #0 C:\xampp\htdocs\planlet\src\Parse\ParseQuery.php(305): Parse\ParseClient::_request('GET', '/1/classes/Scho...', NULL, NULL, false) #1 C:\xampp\htdocs\planlet\src\Parse\ParseQuery.php(248): Parse\ParseQuery->find(false) #2 C:\xampp\htdocs\planlet\src\Parse\ParseQuery.php(70): Parse\ParseQuery->first(false) #3 C:\xampp\htdocs\planlet\first.php(23): Parse\ParseQuery->get('schoolName') #4 {main} thrown in C:\xampp\htdocs\planlet\src\Parse\ParseClient.php on line 250

      

now i am working on my localhost xampp server XAMPP 1.8.2 [PHP: 5.4.31]

How to solve this problem?

+3


source to share


2 answers


The section https://groups.google.com/forum/#!topic/parse-developers/f5RPj6DHA2E has a patch provided by Atif Ghaffar to work with the Parse SDK in XAMPP.



You can fix the problem by replacing the ParseClient.php file at https://gist.githubusercontent.com/allinora/df4dde146bdc4d635306/raw/67a4c2a560e3f69c3d4e4f51b00e5711dc94b520/ParseClient.php

+6


source


I had the same problem. you need to say that curl does not check the ssl peer in the parsing library. To do this go to Parse / ParseClient.php

open this file you will find

 $rest = curl_init();

      



after this line add the following code

curl_setopt($rest, CURLOPT_SSL_VERIFYPEER, false);

      

this will solve your problem.

+2


source







All Articles