PHP did not work?

Home - PHP did not work?

Jordan Maulana asked 1 year ago

i followed PHP tutorial for mesosfer in GitHub

i have installed all the requirements, but i wonder why it did not work at all..
if i miss the requirement, there will be an error, yes i experienced it .
Now i got all the requirements in latest version, there is no error anymore..
My code is as the same as in the tutorial.. why did not work???

12 Answers
Badrullami Staff answered 1 year ago

Hi Jordan,
Are you sure to put username and password correctly?
I just try to register with python then login with php and it works.

Jordan Maulana answered 12 months ago

i register all correctly,
i can login all account with android,

but login with PHP only succeed with PHP account,
and python login with python account..

Badrullami Staff answered 12 months ago

Hi Jordan,
Can you attach your code here? I wan’t try with my data.

Jordan Maulana answered 12 months ago

require dirname(__DIR__).’\mesosfer\vendor\autoload.php’;
const APP_ID = “secret”;
const APP_KEY = “secret”;
$email = $_POST[’email’];
$password = $_POST[‘password’];
$client = new \GuzzleHttp\Client();
$respAuth = $client->request(‘POST’, ‘;, [
‘json’ => [’email’ => $email, ‘password’ => $password],
‘headers’ => [‘X-Mesosfer-AppId’ => APP_ID, ‘X-Mesosfer-AppKey’ => APP_KEY]
$bodyAuth = (string) $respAuth->getBody();
$auth = json_decode($bodyAuth);
catch(Exception $e){
echo $e->getMessage();

that is login with php

Badrullami Staff answered 12 months ago

Hi Jordan,
I tried to run your source code. Register from python then login with php. It’s work like attached image below¬†:

Do you make sure that your registration process was successful?

Your Answer