PHP Startup: Unable to load dynamic library 'smbclient.so'

Nextcloud version 16.0.3.0
Ubuntu 18.04.3 LTS
Apache 2.4.41
PHP version 7.3.9

Hello,

I had a perfect installation of Nextcloud on my server at first but now I am getting 2 errors/warnings,

the first error is:

PHP Startup: Unable to load dynamic library ‘smbclient.so’ (tried: /usr/lib/php/20180731/smbclient.so (libmsrpc3.so.0: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/smbclient.so.so (/usr/lib/php/20180731/smbclient.so.so: cannot open shared object file: No such file or directory)) at Unknown#0

the second is a security and setting warning, it says i’m missing PHP module “imagick”.

I was going to just post about the smbclient error but I thought the other error message would be helpful in diagnosing problem. Of course the newest version of php-imagick is already installed.

Where should I begin? It seems like tackling the smbclient error is the first place to start.

You are most likely missing the ubuntu packages. On command line:

sudo apt update
sudo apt install smbclient
sudo apt install php-imagick

should do the trick.

1 Like

Thank you for the reply, I don’t have access to my server right now, so I can’t test out the apt install smbclient , but I can say with certainty that I did attempt apt install php-imagick and the latest version has already been installed.

Ok, I ran your suggested command promps, with interesting results. first smbclient was NOT installed & php-imagick was installed.

The results is that I no longer have the warning saying that PHP module imagick is missing BUT I still have the smbclient.so error.

[PHP] Error: PHP Startup: Unable to load dynamic library ‘smbclient.so’ (tried: /usr/lib/php/20180731/smbclient.so (libmsrpc3.so.0: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/smbclient.so.so (/usr/lib/php/20180731/smbclient.so.so: cannot open shared object file: No such file or directory)) at Unknown#0

at 2019-10-01T23:15:02+02:00

Is there another thing I can look at to fix this issue? Thank you,

You also have to install libsmbclient:
sudo apt install libsmbclient
Then try again.

libsmbclient was already installed. Here are the results

libsmbclient is already the newest version (2:4.7.6+dfsg~ubuntu-0ubuntu2.11).
libsmbclient set to manually installed.

What makes me think is that the error message indicates that the library is searched for in
/usr/lib/php/20180731/smbclient.so
When you call
sudo dpkg -L libsmbclient
you find where the official library is installed. Does the folder /usr/lib/php/20180731 exist? How was it created?

Thanks for the clues diagnosing the problem, I will look into that and report back.

Hi,
Same problem here, but you didn’t report back, can you tell me a bit more ?
smbclient.so is under /usr/lib/php/20180731/smbclient.so, but I always get this error message :

PHP Warning:  PHP Startup: Unable to load dynamic library 'smbclient.so' (tried: /usr/lib/php/20180731/smbclient.so (games

And with the crontab command from Nextcloud or when I use “php -v” command I get this :

PHP Warning:  PHP Startup: Unable to load dynamic library 'smbclient.so' (tried: /usr/lib/php/20180731/smbclient.so (games
Filename: pool/main/g/golly/golly_2.8-1_armhf.deb
Size: 2490296
SHA256: 540581378e71be068bf5b96b69e449b5d94b438d6e86e5ceaf8fb3a89d052e6a
SHA1: 2e7422514042efa50326d60366edbf1af46ab41a
MD5sum: e0b3c56b4c826a36d5464d55d7179f41
Description: Game of Life simulator using hashlife algorithm
 Golly simulates Conway's Game of Life with an arbitrarily large grid
 of cells.  It can optionally use a hashlife algorithm, which allows
 it to rapidly compute generations for huge patterns, and to compute
 many generations into the future at a time.
 .
 Golly provides a graphical interface for viewing and editing cellular
 automata.  It supports copy and paste, zoom, auto-fit, multiple
 layers, and viewing different areas of a pattern simultaneously in
 different areas of a window.
 .
 Golly can load patterns from RLE, Life 1.05/1.06, dblife, and
 macrocell file formats; it can also interpret images as Life
 patterns.  in Unknown on line 0
PHP 7.3.12-1+0~20191128.49+debian9~1.gbp24559b (cli) (built: Nov 28 2019 07:38:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.12-1+0~20191128.49+debian9~1.gbp24559b, Copyright (c) 1999-2018, by Zend Technologies

Can some of you help me about that ?

Best regards

Hello, sorry for the late response, I haven’t had the time to address this error but I will look into it further in the future. I’m doing a kitchen remodel and my wife is due in February, really no time to fix my server, it’s still working ok, but not optimal.

Same problem. … and congrats! Soon your child will be old enough to follow up on your behalf :stuck_out_tongue:

Hi,

i was just facing this error on Ubuntu 22 LTS.
In my case it helped to remove and reinstall libsmbclient:

sudo apt update
sudo apt remove libsmbclient
sudo apt install libsmbclient
1 Like

THIS IS THE SOLUTION… tried it and it still worked for me!

ESTA ES LA SOLUCION… la probe e igualmente me funciono!

I am in the same situation. On Ubuntu 22.04, was at Nextcloud 25.0.5 this morning and just moved to 25.10 and now at 26.0.5 (the latest 26.x) I’m getting this same problem

PHP Startup: Unable to load dynamic library ‘smbclient.so’ (tried: /usr/lib/php/20210902/smbclient.so (/usr/lib/php/20210902/smbclient.so: cannot open shared object file: No such file or directory), /usr/lib/php/20210902/smbclient.so.so (/usr/lib/php/20210902/smbclient.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

I have tried removing and installing libsmbclient, then rebooting. It did not help.

UPDATE: I fixed it by doing installing php-smbclient.

sudo apt install php8.1-smbclient php-smbclient