This is an old revision of the document!
Table of Contents
How to install NGINX + PHP-FPM on Raspberry Pi
Credits
The original article was published at Raspberry Hosting. It was written for an earlier Raspberry Pi OS. I've since installed nginx and php on the latest OS, Bullseye. The kernel was last compiled on October 26, 2022.
Details
Please refer to the original article for the discussion. I'd repost it but I suspect I'd get in trouble for copyright violations.
It should be obvious but you need to be root to run these commands. If you are a purist you'll want to preface each command with sudo, but I'm sure some of these steps will fail if you do, so I suggest you become root by executing this command:
sudo -i
Pretty much every time you are about to install from the repo, you need to do this:
apt-get update && apt-get -y upgrade
The name of the package has changed from php-apc to php-apcu so:
apt-get install nginx php-fpm php-apcu
The repo doesn't have mysql any longer. So install mariadb instead:
apt-get install mariadb-client mariadb-server php-mysql phpmyadmin
Before we go any farther, let me add something:
export DOMAIN=mydomain.com
That way you can copy and paste the commands without substituting your domain name. Just remember to change that export command.
This section is identical to the original
addgroup --gid 10000 group001 adduser --home /home/x10.local -shell /dev/null --uid 10000 --gid 10000 \ --disabled-password --disabled-login --gecos '' user001
The backslash at the end of the adduser is a continuation character. The adduser command ends with the “user001”.