libsmbclient-php icon indicating copy to clipboard operation
libsmbclient-php copied to clipboard

smbclient server setup

Open MarcS1975 opened this issue 3 years ago • 5 comments

I had several SMB connections setup inside Nextcloud using smbclient and it worked fine. I now had to move my Nextcloud server to a different subnet but smbclient (via Nextcloud) setup still points to the old server addresses and constantly brings error messages in the Nextcloud logs. Unfortunately I cannot log into Nextcloud to make any changes. How can I disable smbclient or amend the server address pointers manually in the CLI?

MarcS1975 avatar Feb 07 '22 17:02 MarcS1975

I am trying to install 'Nextcloud' on my home server, and I want to use the php SMB module.

My server is currently running

OS: Ubuntu 20.04 LTS
Webserver: Nginx 1.18.0 (Ubuntu
Database: PostgreSQL 12.9
Hyper Text: PHP 7.4.3 (With FPM)

-Database Connection Module: pdo_pgsql

-Installed php-Modules: ctype, curl, dom, gd, json, libxml, mbstring, openssl, posix, session, SimpleXML, XMLReader, XMLWriter, zip, zlib

I am trying to install an SMB client for Samba, and it is listed on the next cloud website https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation When I run $ php -m | grep -i smbclient I get no result, so I ran $ sudo apt install php-smbclient -y but that gave me an error

$ sudo apt install php-smbclient -y
Reading package lists... Done
Building dependency tree

Reading state information... Done
Package php-smbclient is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'php-smbclient' has no installation candidate

So I checked the documentation for the smbclient for SMB/CIFS https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage/smb.html and it says the package is called libsmbclient-php. When I try $ sudo apt install libsmbclient-php -y I get an error

Reading package lists... Done
Building dependency tree

Reading state information... Done
E: Unable to locate package libsmbclient-php

I found that on https://pkgs.org/search/?q=smbclient the SMB php-module package is called smbclient So I tried sudo apt install smbclient and it installed that one but when I run $ php -m | grep -i smbclient I still get no result.

Matthodric avatar Mar 29 '22 02:03 Matthodric

@Matthodric , it looks like Canonical didn't build php-smbclient on 20.04, we'll have to investigate why. In the meantime I suggest you use the pecl method: pecl install smbclient It seems like it will be on 22.04, which is odd: https://packages.ubuntu.com/search?keywords=php-smbclient

eduardok avatar Mar 30 '22 15:03 eduardok

It is a licensing concern, so it probably won't be resolved any time soon: https://bugs.launchpad.net/ubuntu/+source/php-smbclient/+bug/1858227

eduardok avatar Mar 30 '22 15:03 eduardok

@Matthodric , it looks like Canonical didn't build php-smbclient on 20.04, we'll have to investigate why. In the meantime I suggest you use the pecl method: pecl install smbclient It seems like it will be on 22.04, which is odd: https://packages.ubuntu.com/search?keywords=php-smbclient

Yeah, I managed to get some help from a friend and got the pecl method installed.

Matthodric avatar Mar 30 '22 16:03 Matthodric

It is a licensing concern, so it probably won't be resolved any time soon: https://bugs.launchpad.net/ubuntu/+source/php-smbclient/+bug/1858227

Thanks for letting me know, I appreciate it. Take care and I hope you have a good day.

Matthodric avatar Mar 30 '22 16:03 Matthodric