Update: I have managed to use the ssh to connect to my host. I have succesfully installed the package with the composer. Now the problem seems to be on the code itself I guess. Although I still get the very same http 500 error.
Here’s the code nevertheless:
<?php
$client = new MongoDB\Client(
'mongodb+srv://myusername:mypassw@apsan.sodk5.mongodb.net/myFirstDatabase?retryWrites=true&w=majority');
$db = $client->test;
?>
Did I miss anything? I simply used the command composer require mongodb/mongodb and installed it through ssh.