Questions about Moralis Database Server

Are PHP supported for communication with database server?

What you mean by communication with the database server? How do you want to connect? It should work either way.

Is there any Rest API that can be used in backend side ?

Sorry for my question(s) iā€™m still new in this .

https://docs.moralis.io/moralis-server/database/direct_access

You can also search how to connect to parse server as parse server is used. Maybe there are some libraries for parse server and php

Hello!

I am trying to use PHP Parse to access my server using these settings:

Receiving an auth error. Do I need the REST key and which is it if so? Thanks!

image

how do you try to authenticate?

usually you donā€™t authenticate from server side code.

Thank you. Iā€™ve gotten further (I think).

$query = new ParseQuery("_User");
$object = $query->get("rQs0zaIwaGFFhD3tKqNIBtTA");

This statement triggers an exception about a Bad Request. It has to do with requests coming back from the server as text/html and not json. I am not using any authentication.

Parse\ParseException Object
(
    [message:protected] => Bad Request
    [string:Exception:private] => 
    [code:protected] => -1
    [file:protected] => /var/www/html/proteamedge/public/wp-content/themes/memberlite-child-master/vendor/parse/php-sdk/src/Parse/ParseClient.php
    [line:protected] => 579
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /var/www/html/proteamedge/public/wp-content/themes/memberlite-child-master/vendor/parse/php-sdk/src/Parse/ParseQuery.php
                    [line] => 699
                    [function] => _request
                    [class] => Parse\ParseClient
                    [type] => ::
                )

            [1] => Array
                (
                    [file] => /var/www/html/proteamedge/public/wp-content/themes/memberlite-child-master/vendor/parse/php-sdk/src/Parse/ParseQuery.php
                    [line] => 551
                    [function] => find
                    [class] => Parse\ParseQuery
                    [type] => ->
                )

            [2] => Array
                (
                    [file] => /var/www/html/proteamedge/public/wp-content/themes/memberlite-child-master/vendor/parse/php-sdk/src/Parse/ParseQuery.php
                    [line] => 125
                    [function] => first
                    [class] => Parse\ParseQuery
                    [type] => ->
                )

            [3] => Array
                (
                    [file] => /var/www/html/proteamedge/public/wp-content/themes/memberlite-child-master/alpn_handle_topic_select.php
                    [line] => 37
                    [function] => get
                    [class] => Parse\ParseQuery
                    [type] => ->
                )

        )

    [previous:Exception:private] => 
)

if you want to query User class from server side then you can use master key

by default you can not read any user data because of the ACL

Iā€™m initializing using the recommended keys:

From my dashboard:
$parseClient->initialize( ā€œAPPIDā€, null, ā€œMASTERKEYā€ );

The middle value is REST API KEY. Is it required? Iā€™ve tried every way I can think of.

Thanks!

where did you add the server url?

If I can help anyone not knowledgeable in the Parse Platform. Donā€™t get thrown off by the python example in the manual referring to ā€œparseā€. ā€œserverā€ replaces ā€œparseā€.

$parseClient->setServerURL('https://h2yoot4zcjng.usemoralis.com:2053','server');