How to upgrade Nextcloud expecially php version on Ubuntu
Posted onIntutorialViews: Word count in article: 3.7kReading time ≈3 mins.
Recently, I tried to upload files to VPS through Nextcloud in order to backup my files. But I found the upload speed was quite slow on Windows official client. So I tried to upgrade Nextcloud to the latest version in order to improve its performance. Though the performance did not improve a lot, I learned how to upgrade Nextcloud especially php. In later, I would upload files via webpage for a better performance.
Update: The bottleneck is the network quality between local and server. Now I am using Filezilla to upload files via multiple threads in order to overcome the limit of single thread speed.
Nextcloud provided a great upgrade method in webpage, you just need to follow the instructions in the Administration pages. However, some steps like php upgrade need to be done manually. Now I will demonstrate how to update php from 8.1 which is deprecated to 8.3.
; Maximum amount of memory a script may consume ; https://php.net/memory-limit memory_limit = 1G
; Maximum allowed size for uploaded files. ; https://php.net/upload-max-filesize upload_max_filesize = 100G
; Maximum number of files that can be uploaded via a single request max_file_uploads = 200
; Maximum size of POST data that PHP will accept. ; Its value may be 0 to disable the limit. It is ignored if POST data reading ; is disabled through enable_post_data_reading. ; https://php.net/post-max-size post_max_size = 100G
; The amount of memory for interned strings in Mbytes. ;opcache.interned_strings_buffer=8 opcache.interned_strings_buffer=16
; Maximum execution time of each script, in seconds ; https://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI ; max_execution_time = 30 max_execution_time = 3600
; Maximum amount of time each script may spend parsing request data. It's a good ; idea to limit this time on productions servers in order to eliminate unexpectedly ; long running scripts. ; Note: This directive is hardcoded to -1 for the CLI SAPI ; Default Value: -1 (Unlimited) ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) ; https://php.net/max-input-time ; max_input_time = 60 max_input_time = 3600
1
vim /var/www/Nextcloud/config/config.php # add below in the last, which means do maintenance at 22:00 UTC
1
'maintenance_window_start' => 22,
1
vim /etc/apache2/sites-available/your.domain.conf # increase request body size and timeout in apache2