parse.com-php-library icon indicating copy to clipboard operation
parse.com-php-library copied to clipboard

"Trying to get property of non-object" error

Open michalbobo opened this issue 11 years ago • 6 comments
trafficstars

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.

michalbobo avatar Apr 22 '14 17:04 michalbobo

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.

Wanted33 avatar Apr 24 '14 09:04 Wanted33

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

michalbobo avatar Apr 24 '14 12:04 michalbobo

Hi,

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

Wanted33 avatar Apr 26 '14 14:04 Wanted33

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

michalbobo avatar Apr 27 '14 12:04 michalbobo

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

michalbobo avatar May 02 '14 13:05 michalbobo

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 :)

Wanted33 avatar May 03 '14 09:05 Wanted33