You are here
Danilo - Fri, 2021/07/02 - 19:40
Hello friends, I need to give a command in nextcloud , but it doesn't work! File upload is very slow in windows app, and this command seems to solve. But on turnkey image does not work. Any idea? Thanks
Command:
sudo -u www-data php occ config:app:set files max_chunk_size --value 0
Forum:
Use 'turnkey-occ', or use 'su', or install 'sudo'.
As of v16.1 TurnKey Nextcloud includes a 'turnkey-occ' command (a simple wrapper around 'occ'). If you aren't on v16.1, then you can download it (and make it executable) like this:
Then you can use it instead of 'occ'. I.e to run the command you noted, this should work:
Alternatively, if you'd rather use occ directly, you can use 'su', like this:
Or finally, if you'd rather use 'sudo', install it first:
Then you should be able to use it as per your original post.
If you continue to have issues, please post the appliance version you are using (if unsure, post the output of 'turnkey-version'), where it's running and any error messages you are seeing.
Turnkey-occ command php version change
If you face issues with turnkey-occ reporting :
this most probably comes from the nextcloud apache2 server using php8.1 whereas the php command points to the 8.2 version. Both versions configs can be seen under /etc/php/[8.1,8.2]. It turns out that the 8.1 version includes an apache2 subdirectory containing some php init files that happen to have differences with the standard php.ini of the 8.2 version (I could not find what was the exact issue though...).
In order to get occ to be launched using the same config and version of php as for the nexcloud sever, it is necessary to edit (nano) the turnkey-occ script under /usr/local/bin and just change php command:
This will allow running the occ command with the same config as the nextcloud/apache2 server and get rid of this driver not found issue.
Hope this helps as it took me several hours to understand this while I was dumb enough to lose my login passwords for both the nextcloud admin and user accounts...
Thanks for posting and providing a workaround
Hi Chris. Thanks for posting.
BTW, if you want to sign up for an account (so you don't need to wait for me to approve your future posts) please do so. Then let me know that you are waiting for approval. Do that either by noting it in a reply here, or over on the relevant thread, or shoot me an email to support AT turnkeylinux.org.
Whilst what you did obviously works and strictly speaking, there's absolutely nothing wrong with it, probably the "proper" way to resolve that is to update the version of PHP that /usr/bin/php points to. As you're using php8.1 as the PHP version for Apache, I would argue that the default /usr/bin/php should also be php8.1!
In Debian, whilst many system executables are binary files (i.e. actual programs/commands located in /usr/bin), many of them are actually just symlinks to other (often version specific) commands that provide the same or similar functionality. Which specific command these "generic" commands point to is managed by the "alternatives" system. php (or more correctly /usr/bin/php) is one of those. To view all the real executables available for php (aka /usr/bin/php) on your system, run this:
And then set the desired one like this (e.g. php8.1):
Or if you'd rather do it interactively, run this:
Then double check that it worked:
It should show that it's now php8.1! :)
Add new comment