M
M
mihail-lisin2018-09-04 17:15:46
PHP
mihail-lisin, 2018-09-04 17:15:46

http 500 error while setting up mongodb, anyone faced the same issue?

Good evening!
Setting up a new Debian 9 on a VDS server.
I plan to connect the database to cloud.mongodb
Installed php 7.0.3
Installed the php driver in this way

$ pecl install mongodb
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`

Enabled the mongodb extension through the isp panel
Restarted Apache.
phpinfo says "MongoDB extension version 1.5.2" - everything is fine.
But when called:
$client = new MongoDB();

or:
$client = new MongoDB('there is a row to the database');

The page with the mongo call gives:
Page not available
The NAME.COM site cannot process this request yet.
HTTP ERROR 500
What did I do wrong?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Ezhgurov, 2018-09-04
@eandr_67

Just turn on the PHP settings to display errors in the browser. And you will see what exactly happened in the PHP code (error 500 in 99.9% of cases is caused by PHP script errors).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question