andrewscofield / parse.com-php-library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Trying to get property of non-object" error

michalbobo opened this issue · comments

Hi,
I'm being stuck on using this library. I'm trying to just save a new object the same way as in the example but i'm getting php notice "Trying to get property of non-object". It seems like $response is FALSE. I'm running on localhost - XAMPP. Is there any fix for this or am I doing something wrong?
Thanks.

Hi ,

Can you put an exemple of your request to save your new object to help you ?

I can show you an exemple of a request to save a new object if you want. For exemple to save an article we can do :

$parse = new parseObject('Articles');
$parse->article_author = array("__type" => "Pointer", "className" => "_User", "objectId" => $userID);
$parse->articles = $content;
$r = $parse->save();

(with $content = $_POST['content'])

I hope i can help you.

Hi,
thanks for response. However it's not a syntax problem or anything. When I move my project to web hosting it is correctly working. When I'm trying to run my project on localhost, there is some kind of SSL problem and therefore parse is not responding ($response = FALSE).

Hi,

Is the option "short_open_tags" is enable when you make a ?

I tried to turn ON short_open_tags, restart my server and everything but I'm still getting the same error..

OK, so the problem is definitely the SSL. I added "curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);" to request() in parse.php and it works. Allthough this is just a temporary solution...

HI,

I'm sorry but i don't know where the problem come from and i haven't got solutions to help you :/. But i think you can keep your temporary solution for the moment :)