找了一些帖子,发现下文这个是最详细清晰的,转载分享: https://pimylifeup.com/raspberry-pi-nextcloud-server/
Installing Apache and PHP
To run Nextcloud on the Raspberry Pi we will first need to install and setup Apache and PHP.
We won’t be going too in-depth into installing these as they are a minor components to this tutorial.
If you want to learn more about setting up a Web Server, then be sure to follow our tutorial on how to do this.
For the best performance I recommend using Raspbian lite but just normal Raspbian will also work just as well.
If you need information on how to set this all up check out the guide in the Pi operating systems section.
For this tutorial, we will make use of the latest available version of PHP 8.
1. To get started let’s first update our package repositories with the following command:
sudo apt update
sudo apt upgrade