I have a VPS with Debian 8 OS and a DirectAdmin panel with PHP7.2
To use MongoDB PHP driver, I installed it with the command sudo pecl install mongodb
.
After that installation, I added the driver extension to the php.ini file by this command:
echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"
But it seems that driver not installed! Because when I exec a PHP command, face this warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/mongodb.so (/usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/mongodb.so: cannot open shared object file: No such file or directory), /usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/mongodb.so.so (/usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/mongodb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Everything is ok in my local (windows), I add the Non Thread Safe (NTS) driver extension to the extensions directory, and It's all!
What I did wrong? Is installation of MongoDB driver on the PHP of DirectAdmin different from installation on a normal PHP?
Update:
MongoDB is not in the result of phpinfo();
too!
mongodb.so
exist in the extension dir? Because the error says it does not. – Daniel W./usr/local/php72/lib/php/extensions/no-debug-non-zts-20170718/
, No! there are just two files,opcache.a
andopcache.so
– Behnam Azimiextension_dir
configuration and put the.so
files in the appropriate folder, problem solved. – Daniel W..so
file, what do you mean fix! – Behnam Azimimongodb.so
file is installed in the extensions dir which is the one before you changed it..... what folders are in/usr/local/php72/lib/php/extensions
? Or simply usefind
and search for the file – Daniel W.