Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb.so' #1505

Open
thangbv opened this issue Dec 28, 2023 · 2 comments
Open

PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb.so' #1505

thangbv opened this issue Dec 28, 2023 · 2 comments

Comments

@thangbv
Copy link

thangbv commented Dec 28, 2023

I installed on Centos 7 with PHP 7.4.
MongoDB server is 7.0.4. But when starting nginx, I receive a warning:
PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /usr/lib64/php/modules/mongodb.so (/usr/lib64/php/modules/mongodb.so: undefined symbol: BIO_meth_set_read), /usr /lib64/php/modules/mongodb.so.so (/usr/lib64/php/modules/mongodb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0.
Also in php.ini don't see mongodb extension

@GromNaN
Copy link
Member

GromNaN commented Jan 4, 2024

How did you install the mongodb php extension?
Do you have the same PHP version running on the cli and php-fpm?
Did you restart php-fpm after installing the mongodb extension?

@cloud-chang
Copy link

@GromNaN same question

php8.2 ,ubuntu 22 :

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20210902/mongodb.so' (tried: /usr/lib/php/20210902/mongodb.so (/usr/lib/php/20210902/mongodb.so: undefined symbol: executor_globals), /home/vscode/software/php/lib/php/extensions/no-debug-zts-20220829//usr/lib/php/20210902/mongodb.so.so (/home/vscode/software/php/lib/php/extensions/no-debug-zts-20220829//usr/lib/php/20210902/mongodb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

install php

#!/bin/bash
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt install -y autoconf libpng-dev libjpeg-dev git libsystemd-dev build-essential g++ libcurl4-openssl-dev libssl-dev gcc wget pkg-config curl  libxml2 libxml2-dev libzip-dev libonig-dev librust-onig-dev sqlite3 libsqlite3-dev


PREFIX_DIR=$HOME/software/php
./configure --prefix=$PREFIX_DIR --with-fpm-systemd --enable-fpm  --with-curl --enable-mysqlnd --with-zip --with-config-file-path=${PREFIX_DIR}/config --with-config-file-scan-dir=${PREFIX_DIR}/config  --enable-sockets  --with-pdo-mysql  --enable-pcntl   --enable-mbstring  --enable-intl --enable-zts --with-zlib --enable-bcmath --enable-bcmath --with-openssl --enable-gd --with-jpeg; 
make -j4 && make install
echo export PATH=$HOME/software/php/bin:$PATH>>~/.bashrc;
source ~/.bashrc;

install mongodb

sudo pecl install mongodb

Do you have the same PHP version running on the cli and php-fpm?

no

Did you restart php-fpm after installing the mongodb extension?

yes, still not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants