eduardok / libsmbclient-php

smbclient's extension for PHP
Other
96 stars 21 forks source link

smbclient server setup #95

Open MarcS1975 opened 2 years ago

MarcS1975 commented 2 years ago

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?

Matthodric commented 2 years ago

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.

eduardok commented 2 years ago

@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 commented 2 years ago

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

Matthodric commented 2 years ago

@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 commented 2 years ago

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.