I am trying to use Parse in a php script.
I have done to following:
Uploaded the files 'autoload.php' and the folder 'Parse' from here to the root directory of the server https://github.com/parseplatform/parse-php-sdk
Then I created an index.php with the following test code from here: https://www.webniraj.com/2014/08/05/parse-com-using-the-official-parse-php-sdk-v1-0-x/
// define location of Parse PHP SDK, e.g. location in "Parse" folder
// Defaults to ./Parse/ folder. Add trailing slash
define( 'PARSE_SDK_DIR', './Parse/' );
// include Parse SDK autoloader
require_once( 'autoload.php' );
// Add the "use" declarations where you'll be using the classes
use Parse\ParseClient;
use Parse\ParseObject;
use Parse\ParseQuery;
use Parse\ParseACL;
use Parse\ParsePush;
use Parse\ParseUser;
use Parse\ParseInstallation;
use Parse\ParseException;
use Parse\ParseAnalytics;
use Parse\ParseFile;
use Parse\ParseCloud;
// Init parse: app_id, rest_key, master_key
ParseClient::initialize('xxx', 'xxx', 'xxx');
// save something to class TestObject
$testObject = ParseObject::create("TestObject");
$testObject->set("foo", "bar");
$testObject->save();
// get the object ID
echo $testObject->getObjectId();
echo '<h1>Users</h1>';
// get the first 10 users from built-in User class
$query = new ParseQuery("_User");
$query->limit(10);
$results = $query->find();
foreach ( $results as $result ) {
// echo user Usernames
echo $result->get('username') . '<br/>';
}
Of course I replaced the xxx with my app_id, rest_key and master_key
When I now open index.php I am getting Fatal error: Call to undefined function Parse\curl_init() in /Parse/ParseClient.php on line 304
Did I miss to do something?
spl_autoload_registersince that's searching for/src/Parse, not just/ParsePARSE_SDK_DIR