How to connect to mongodb from php [openshift]?

Good evening.
There is a problem trying to zakonektitsya to Mongo via php, get web server 500ую error and that's it.
Have tried login/pass before the environment variables to set and stuff like that, she wasn't.

fixed.
On irc suggested, in short, you need to use the "OPENSHIFT_MONGODB_DB_URL", and not what is offered when connecting to Mongo. Thank you all
July 8th 19 at 16:23
1 answer
July 8th 19 at 16:25
See the error_log it will tell you what went wrong. Or enable error output in PHP.
pastebin.com/AkpRnGtn - Alvera_Hintz31 commented on July 8th 19 at 16:28
:
/usr/bin/tail: error reading `nginx-php7/logs/nginx': Is a directory
Do at least see that send.... - Violet_Wiso commented on July 8th 19 at 16:31
: wrong Tulsa promonitorit, once sent) - Alvera_Hintz31 commented on July 8th 19 at 16:34
:
PHP Fatal error: Uncaug
ht exception 'MongoConnectionException' with message 'Failed to connect to: :0:
php_network_getaddresses: getaddrinfo failed: Name or service not known' in /var
/lib/openshift/57538c9e7628e1825d000111/app-root/runtime/repo/n.php:4\nStack tra
ce:\n#0 /var/lib/openshift/57538c9e7628e1825d000111/app-root/runtime/repo/n.php(
4): MongoClient->__construct('mongodb://:')\n#1 {main}\n thrown in /var/lib/ope
nshift/57538c9e7628e1825d000111/app-root/runtime/repo/n.php on line 4


Variables $OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT empty. - Violet_Wiso commented on July 8th 19 at 16:37

Find more questions by tags PHPMongoDBOpenshift