Im a newbee in Linux but learned a lot with googling my answers. NextCloud is running really well but I can’t get my NC to connect to a samba share. I installed on a clean server with ContOS 7, Direct Admin, Apache & PHP 7.2. smbclient is installed but i’m not sure I need to do some extra configuring.
I tried to install php-smbclient but yum install php-smbclient gives a “No package php-smbclient available.” Is there anyone who can help me in the right direction?
Make sure that you’re installing and configuring the right package for the right PHP version. You will find many reports on this forum where users have installed a package for e.g. PHP 7.0 and wondering why it couldn’t be loaded using PHP 7.2. Please use the search function to find related postings.
Please keep in mind, that you need to check the PHP web and cli component. Best would be to keep the both versions in sync. You can check the loaded modules for the PHP cli component executing php -m, for the PHP web component you have to create a php file which contains <?php phpinfo() ?>and load it using a browser.
Ok, im trying to folow you. Do you mean I have to check if the components of PHP web and the PHP CLI components are the same? In that case, yes they are. But on both i don’t see smbclient. Only in the webpage I see smb and smbs as a protocol under Curl.
I tried to install smbclient with help of a lot tutorials but none of them work in my situation. I get stranded every time. Tried it with info from https://github.com/eduardok/libsmbclient-php but (one of the search results from your google link):
pecl install pecl_http --> pecl: command not found
Now after that you should be able to add an SMB/CIFS share.
If your planning to have the permissions set in windows take effect for different users on the share you need to enable the LDAP Users and Groups Backend app in nextcloud (yum install php72w-ldap) and when creating your SMB/CIFS share globally in Nextcloud make sure you set the authentication to “Login Credentials, Save in Session”. That way when a user logs in and clicks into the share they will only be granted the permissions that the Windows file server allows. This works best with Access Based Enumeration enabled on the Windows File Share.
Hope this helps someone else. I’ve been at this for about 2 weeks and only just figured it out yesterday. Been working perfectly for me since.
Did you get collaboration working ?
My users can access the SMB share in Nextcloud, but instant collaboration is impossible (through NextCloud Text, OnlyOffice…) as the file changes are not propagated.
Sharing the folders could help but that would bypass the existing SMB share file permissions…
Have you installed the Community Document Server and Only Office? You need both to enable Collaborative Document Editing.
I found that I wasn’t able to install the Community Document Server via the GUI as it’s a very large install and PHP or Nginx was timing out. I had to install it using the OCC CLI.
Well that baffles me… OnlyOffice and Document Server are installed and collaboration is only working from local Nextcloud storage, not from SMB.
I installed everything through UCS (Univention), which uses Docker.
Even worse, the only way for me to be able to open a document with OnlyOffice from the SMB share is to set the authentication to « save in database » and not « save in session » (or else I get an error from OnlyOffice that cannot load the document, I guess because it doesn’t have access to the credentials).