Skip to content

Commit d17bd40

Browse files
authored
Docs: Upgrade to PHP v8.4. Explain min hw requirements. And other doc fixes (#1520)
1 parent 6ba0ca7 commit d17bd40

File tree

4 files changed

+61
-37
lines changed

4 files changed

+61
-37
lines changed

docs/02-admin/01-installation/01-bare_metal.md

+41-25
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,28 @@ This guide is aimed for Debian / Ubuntu distribution servers, but it could run o
1111
1212
## Minimum hardware requirements
1313

14-
**CPU:** 2 cores (>2.5 GHz)
15-
**RAM:** 4GB (more is recommended for large instances)
16-
**Storage:** 20GB (more is recommended, especially if you have a lot of remote/local magazines and/or have a lot of (local) users)
14+
- **vCPU:** 4 virtual cores (>= 2GHz, _more is recommended_ on larger instances)
15+
- **RAM:** 6GB (_more is recommended_ for large instances)
16+
- **Storage:** 40GB (_more is recommended_, especially if you have a lot of remote/local magazines and/or have a lot of (local) users)
17+
18+
You can start with a smaller server and add more resources later if you are using a VPS for example.
19+
20+
## Software Requirements
21+
22+
- Debian 12 or Ubuntu 22.04 LTS or later
23+
- PHP v8.3 or higher
24+
- NodeJS v20 or higher
25+
- Valkey / KeyDB / Redis (pick one)
26+
- PostgreSQL
27+
- Supervisor
28+
- RabbitMQ
29+
- Nginx / OpenResty (pick one)
30+
- _Optionally:_ Mercure
31+
32+
This guide will show you how-to install and configure all of the above. Except for Mercure and Nginx, for Mercure see the [optional features page](../03-optional-features/README.md).
33+
34+
> [!TIP]
35+
> Once the installation is completed, also check out the [additional configuration guides](../02-configuration/README.md) (including the Nginx setup).
1736
1837
## System Prerequisites
1938

@@ -29,7 +48,7 @@ Install prequirements:
2948
sudo apt-get install lsb-release ca-certificates curl wget unzip gnupg apt-transport-https software-properties-common python3-launchpadlib git redis-server postgresql postgresql-contrib nginx acl -y
3049
```
3150

32-
On **Ubuntu 22.04 LTS** or older, prepare latest PHP package repositoy (8.3) by using a Ubuntu PPA (this step is optional for Ubuntu 23.10 or later) via:
51+
On **Ubuntu 22.04 LTS** or older, prepare latest PHP package repositoy (8.4) by using a Ubuntu PPA (this step is optional for Ubuntu 23.10 or later) via:
3352

3453
```bash
3554
sudo add-apt-repository ppa:ondrej/php -y
@@ -44,18 +63,18 @@ sudo dpkg -i /tmp/debsuryorg-archive-keyring.deb
4463
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
4564
```
4665

47-
Install _PHP 8.3_ (or install _PHP 8.4_ if you wish) with PHP extensions:
66+
Install _PHP 8.4_ with the required additional PHP extensions:
4867

4968
```bash
5069
sudo apt-get update
51-
sudo apt-get install php8.3 php8.3-common php8.3-fpm php8.3-cli php8.3-amqp php8.3-bcmath php8.3-pgsql php8.3-gd php8.3-curl php8.3-xml php8.3-redis php8.3-mbstring php8.3-zip php8.3-bz2 php8.3-intl php8.3-bcmath -y
70+
sudo apt-get install php8.4 php8.4-common php8.4-fpm php8.4-cli php8.4-amqp php8.4-bcmath php8.4-pgsql php8.4-gd php8.4-curl php8.4-xml php8.4-redis php8.4-mbstring php8.4-zip php8.4-bz2 php8.4-intl php8.4-bcmath -y
5271
```
5372

5473
> [!NOTE]
55-
> If you are upgrading to PHP 8.3 from an older version, please re-review the [PHP configuration](#php) section of this guide as existing `ini` settings are NOT automatically copied to new versions. Additionally review which php-fpm version is configured in your nginx site.
74+
> If you are upgrading to PHP 8.3 from an older version, please re-review the [PHP configuration](#php) section of this guide as existing `ini` settings are NOT automatically copied to new versions. Additionally review which php-fpm version is configured in your Nginx site.
5675
5776
> [!IMPORTANT]
58-
> **Never** even install `xdebug` PHP extension in production environments. Even if you didn't enabled it but only installed `xdebug` can give massive performance issues.
77+
> **Never** even install `xdebug` PHP extension in production environments. Even if you don't enabled it but only installed `xdebug` can give massive performance issues.
5978
6079
Install Composer:
6180

@@ -64,35 +83,32 @@ sudo curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
6483
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
6584
```
6685

67-
## Firewall
86+
## Nginx / OpenResty
6887

69-
If you have a firewall installed (or you're behind a NAT), be sure to open port `443` for the web server. Mbin should run behind a reverse proxy like Nginx.
88+
Mbin bare metal setup requires a reverse proxy called Nginx (or OpenResty) to be installed and configured correctly. This is a requirement for Mbin to work safe, properly and to scale well.
7089

71-
For Nginx see: [Nginx configuration](../02-configuration/02-nginx.md).
90+
For Nginx/OpenResty setup see the [Nginx configuration](../02-configuration/02-nginx.md).
7291

73-
## Install NodeJS (frontend tools)
92+
## Firewall
93+
94+
If you have a firewall installed (or you're behind a NAT), be sure to open port `443` for the web server. As said above, Mbin should run behind a reverse proxy like Nginx or OpenResty.
95+
96+
## Install Node.JS (frontend tools)
7497

7598
1. Prepare & download keyring:
7699

77100
> [!NOTE]
78101
> This assumes you already installed all the prerequisites packages from the "System prerequisites" chapter.
79102
80-
```bash
81-
sudo mkdir -p /etc/apt/keyrings
82-
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
83-
```
84-
85-
2. Setup deb repository:
103+
1. Setup the Nodesource repository:
86104

87105
```bash
88-
NODE_MAJOR=20
89-
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
106+
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash -
90107
```
91108

92-
3. Update and install NodeJS:
109+
3. Install Node.JS:
93110

94111
```bash
95-
sudo apt-get update
96112
sudo apt-get install nodejs -y
97113
```
98114

@@ -254,7 +270,7 @@ See also: [Mbin config files](../02-configuration/01-mbin_config_files.md) for m
254270
Edit some PHP settings within your `php.ini` file:
255271

256272
```bash
257-
sudo nano /etc/php/8.3/fpm/php.ini
273+
sudo nano /etc/php/8.4/fpm/php.ini
258274
```
259275

260276
```ini
@@ -299,7 +315,7 @@ More info: [Symfony Performance docs](https://symfony.com/doc/current/performanc
299315
Edit your PHP `www.conf` file as well, to increase the amount of PHP child processes (optional):
300316

301317
```bash
302-
sudo nano /etc/php/8.3/fpm/pool.d/www.conf
318+
sudo nano /etc/php/8.4/fpm/pool.d/www.conf
303319
```
304320

305321
With the content (these are personal preferences, adjust to your needs):
@@ -315,7 +331,7 @@ pm.max_spare_servers = 10
315331
Be sure to restart (or reload) the PHP-FPM service after you applied any changing to the `php.ini` file:
316332

317333
```bash
318-
sudo systemctl restart php8.3-fpm.service
334+
sudo systemctl restart php8.4-fpm.service
319335
```
320336

321337
### Composer

docs/02-admin/01-installation/02-docker.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
> [!NOTE]
44
> Docker installation is currently not advised for production use. Try the [Bare Metal installation](01-bare_metal.md) instead.
55
6-
## System Requirements
6+
## Minimum hardware requirements
7+
8+
- **vCPU:** 4 virtual cores (>= 2GHz, _more is recommended_ on larger instances)
9+
- **RAM:** 6GB (_more is recommended_ for large instances)
10+
- **Storage:** 40GB (_more is recommended_, especially if you have a lot of remote/local magazines and/or have a lot of (local) users)
11+
12+
You can start with a smaller server and add more resources later if you are using a VPS for example.
13+
14+
## System Prerequisites
715

816
- Docker Engine
917
- Docker Compose V2

docs/02-admin/FAQ.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Followed by restarting the services that are depending on the (new) configuratio
176176

177177
```bash
178178
# Clear PHP Opcache by restarting the PHP FPM service
179-
sudo systemctl restart php8.2-fpm.service
179+
sudo systemctl restart php8.4-fpm.service
180180
181181
# Restarting the PHP messenger jobs and Mercure service (also reread the latest configuration)
182182
sudo supervisorctl reread && sudo supervisorctl update && sudo supervisorctl restart all

docs/03-contributing/01-getting_started.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
There are several ways to get started. Like using the Docker setup or use the development server, which is explained in detail below.
44

5-
The code is mainly written in PHP using the Symfony framework with Twig templating and a bit of JavaScript & CSS.
5+
The code is mainly written in PHP using the Symfony framework with Twig templating and a bit of JavaScript & CSS and of course HTML.
66

77
## Initial setup
88

99
Requirements:
1010

1111
- PHP v8.3 or higher
12-
- NodeJS
13-
- Valkey / KeyDB / Redis
12+
- NodeJS v20 or higher
13+
- Valkey / KeyDB / Redis (pick one)
1414
- PostgreSQL
1515
- _Optionally:_ Mercure
1616
- _Optionally:_ Symfony CLI
@@ -46,18 +46,18 @@ git clone [email protected]:MbinOrg/mbin.git
4646
1. Install PHP + additional PHP extensions:
4747

4848
```sh
49-
sudo apt install php8.3 php8.3-common php8.3-fpm php8.3-cli php8.3-amqp php8.3-bcmath php8.3-pgsql php8.3-gd php8.3-curl php8.3-xml php8.3-redis php8.3-mbstring php8.3-zip php8.3-bz2 php8.3-intl php8.3-bcmath -y
49+
sudo apt install php8.4 php8.4-common php8.4-fpm php8.4-cli php8.4-amqp php8.4-bcmath php8.4-pgsql php8.4-gd php8.4-curl php8.4-xml php8.4-redis php8.4-mbstring php8.4-zip php8.4-bz2 php8.4-intl php8.4-bcmath -y
5050
```
5151

5252
2. Fine-tune PHP settings:
5353

54-
- Increase execution time in PHP config file: `/etc/php/8.3/fpm/php.ini`:
54+
- Increase execution time in PHP config file: `/etc/php/8.4/fpm/php.ini`:
5555

5656
```ini
5757
max_execution_time = 120
5858
```
5959

60-
- _Optional:_ Increase/set max_nesting_level in `/etc/php/8.3/fpm/conf.d/20-xdebug.ini` (in case you have the `xdebug` extension installed):
60+
- _Optional:_ Increase/set max_nesting_level in `/etc/php/8.4/fpm/conf.d/20-xdebug.ini` (in case you have the `xdebug` extension installed):
6161

6262
```ini
6363
xdebug.max_nesting_level=512
@@ -66,7 +66,7 @@ xdebug.max_nesting_level=512
6666
3. Restart the PHP-FPM service:
6767

6868
```sh
69-
sudo systemctl restart php8.3-fpm.service
69+
sudo systemctl restart php8.4-fpm.service
7070
```
7171

7272
## Prepare PostgreSQL DB
@@ -205,19 +205,19 @@ For more info read: [Symfony Testing guide](https://symfony.com/doc/current/test
205205

206206
### Prepare testing
207207

208-
1. First increase execution time in your PHP config file: `/etc/php/8.3/fpm/php.ini`:
208+
1. First increase execution time in your PHP config file: `/etc/php/8.4/fpm/php.ini`:
209209

210210
```ini
211211
max_execution_time = 120
212212
```
213213

214-
2. _Optional:_ Increase/set max_nesting_level in `/etc/php/8.3/fpm/conf.d/20-xdebug.ini` (in case you have the `xdebug` extension installed):
214+
2. _Optional:_ Increase/set max_nesting_level in `/etc/php/8.4/fpm/conf.d/20-xdebug.ini` (in case you have the `xdebug` extension installed):
215215

216216
```ini
217217
xdebug.max_nesting_level=512
218218
```
219219

220-
3. Restart the PHP-FPM service: `sudo systemctl restart php8.3-fpm.service`
220+
3. Restart the PHP-FPM service: `sudo systemctl restart php8.4-fpm.service`
221221
4. Copy the dot env file (if you haven't already): `cp .env.example .env`
222222
5. Install composer packages: `composer install --no-scripts`
223223

0 commit comments

Comments
 (0)