How to switch database to mariadb for nextcloud on nginx/php-fpm on Raspberry Pi 4?

Container

Reading Time: 2 minutes

This is the last article which explained how to establish nextcloud environment on nginx/php-fpm. 



This article shows how to switch database from sqlite3 to mariadb.

Before



After



You can see detail about modification.

Modified to use mariadb. · kurofuku/nextcloud-container-fpm@1d5639b
Contribute to kurofuku/nextcloud-container-fpm development by creating an account on GitHub.



If you are familiar with docker-compose, I am sure you this commit is easy to understand.

Let me share one point which HTTP 504 timeout error happened after I switch to mariadb.



It can be guessed that timeout error happened during requesting from nginx to php-fpm.

I resolved by configuring timeout value to 180 seconds.
– I referred this site(Japanese site).

Firstly nginx configuration file default.conf is configured as below.
– If fastcgi_read_timeout is not defined, default value is 60 seconds.
Link



Next is configuration of php-fpm.
request_terminate_timeout is 0 in www.conf.template.
Link

If 0, forcible termination won’t be happened.
I didn’t touch this item.

Lastly I checked php.ini.
Current max_execution_time is 30 seconds, then I changed to 180 seconds.



Then HTTP 504 Gateway Timeout resolved.

As you may see below screen shot, recommended application installation will not be done automatically but it is known issue and can be done by manually entering URL.

Conclusion

How was it?

I will try activating HTTPS of nginx next time!

Comments

Copied title and URL