@@ -29,7 +29,7 @@ In this chapter, you will learn about PHP and PHP-FPM.
2929:checkered_flag : **PHP**, **PHP-FPM**, **Application server**
3030
3131**Knowledge**: :star: :star: :star:
32- **Complexity**: :star: :star: :star:
32+ **Complexity**: :star: :star: :star:
3333
3434**Reading time**: 30 minutes
3535
@@ -59,79 +59,22 @@ Rocky Linux, like its upstream, offers many versions of the language. Some of th
5959
6060To obtain a list of available versions, enter the following command :
6161
62- === "9.3 PHP module list"
63-
6462 ` ` ` bash
65- $ sudo dnf module list php
66-
63+ sudo dnf module list php
64+ Last metadata expiration check: 0:01:43 ago on Tue 21 Oct 2025 02:12:49 PM UTC.
6765 Rocky Linux 9 - AppStream
68- Name Stream Profiles Summary
69- php 8.1 [d] common [d], devel, minimal
66+ Name Stream Profiles Summary
67+ php 8.1 common [d], devel, minimal PHP scripting language
68+ php 8.2 common [d], devel, minimal PHP scripting language
69+ php 8.3 common [d], devel, minimal PHP scripting language
7070
7171 Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
7272 ` ` `
7373
74- The Remi repository offers more recent releases of PHP than the Appstream repository, including versions 8.2 and 8.3.
75-
76- To install the Remi repository, run the following command :
77-
78- ` ` ` bash
79- sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
80- ` ` `
81-
82- Enable the Remi repository by running the following command :
83-
84- ` ` ` bash
85- sudo dnf config-manager --set-enabled remi
86- ` ` `
87-
8874 You can now activate a newer module (PHP 8.3) by entering the following command :
8975
9076 ` ` ` bash
91- sudo dnf module enable php:remi-8.3
92- ` ` `
93-
94- === "8.9 PHP module list"
95-
96- ` ` ` bash
97- $ sudo dnf module list php
98-
99- Rocky Linux 8 - AppStream
100- Name Stream Profiles Summary
101- php 7.2 [d] common [d], devel, minimal PHP scripting language
102- php 7.3 common [d], devel, minimal PHP scripting language
103- php 7.4 common [d], devel, minimal PHP scripting language
104- php 8.0 common [d], devel, minimal PHP scripting language
105-
106- Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
107- ` ` `
108-
109- Rocky provides different PHP modules from its AppStream repository.
110-
111- You will note that Rocky 8.9's default version is 7.2, which has already reached its end of life at the time of this writing.
112-
113- You can activate a newer module by entering the following command :
114-
115- ` ` ` bash
116- sudo dnf module enable php:8.0
117- ==============================================================================================
118- Package Architecture Version Repository Size
119- ==============================================================================================
120- Enabling module streams:
121- httpd 2.4
122- nginx 1.14
123- php 8.0
124-
125- Transaction Summary
126- ==============================================================================================
127-
128- Is this ok [y/N]:
129-
130- Transaction Summary
131- ==============================================================================================
132-
133- Is this ok [y/N]: y
134- Complete!
77+ sudo dnf module enable php:8.3
13578 ` ` `
13679
13780You can now proceed to the installation of the PHP engine.
@@ -144,63 +87,18 @@ The installation of PHP is relatively trivial. It consists of installing the mai
14487
14588The example below installs PHP with the modules usually installed with it.
14689
147- === "9.3 install PHP"
148-
14990 ` ` ` bash
15091 sudo dnf install php php-cli php-gd php-curl php-zip php-mbstring
15192 ` ` `
15293
153- During installation, you will be prompted to import GPG keys for the epel9 (Extra Packages for Enterprise Linux 9) and Remi repositories. Enter y to import the keys :
154-
155- ` ` ` bash
156- Extra Packages for Enterprise Linux 9 - x86_64
157- Importing GPG key 0x3228467C:
158- Userid : "Fedora (epel9) <epel@fedoraproject.org>"
159- Fingerprint: FF8A D134 4597 106E CE81 3B91 8A38 72BF 3228 467C
160- From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9
161- Is this ok [y/N]: y
162- Key imported successfully
163- Remi's RPM repository for Enterprise Linux 9 - x86_64
164- Importing GPG key 0x478F8947:
165- Userid : "Remi's RPM repository (https://rpms.remirepo.net/) <remi@remirepo.net>"
166- Fingerprint: B1AB F71E 14C9 D748 97E1 98A8 B195 27F1 478F 8947
167- From : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el9
168- Is this ok [y/N]: y
169- Key imported successfully
170- Running transaction check
171- Transaction check succeeded.
172- Running transaction test
173- Transaction test succeeded.
174-
175- Complete!
176- ` ` `
177-
178- === "8.9 install PHP"
179-
180- ` ` ` bash
181- sudo dnf install php php-cli php-gd php-curl php-zip php-mbstring
182- ` ` `
183-
184- You can check that the installed version corresponds to the expected one :
185-
186- === "9.3 check PHP version"
187-
188- ` ` ` bash
189- $ php -v
190- PHP 8.3.2 (cli) (built: Jan 16 2024 13:46:41) (NTS gcc x86_64)
191- Copyright (c) The PHP Group
192- Zend Engine v4.3.2, Copyright (c) Zend Technologies
193- with Zend OPcache v8.3.2, Copyright (c), by Zend Technologies
194- ` ` `
195-
196- === "8.9 check PHP version"
94+ Check the version with :
19795
19896 ` ` ` bash
199- $ php -v
200- PHP 7.4 .19 (cli) (built: May 4 2021 11:06:37 ) ( NTS )
201- Copyright (c) The PHP Group
202- Zend Engine v3.4.0 , Copyright (c) Zend Technologies
203- with Zend OPcache v7.4 .19, Copyright (c), by Zend Technologies
97+ php -v
98+ PHP 8.3 .19 (cli) (built: Mar 12 2025 13:10:27 ) (NTS gcc x86_64 )
99+ Copyright (c) The PHP Group
100+ Zend Engine v4.3.19 , Copyright (c) Zend Technologies
101+ with Zend OPcache v8.3 .19, Copyright (c), by Zend Technologies
204102 ` ` `
205103
206104# ## Apache Integration
@@ -344,7 +242,7 @@ pm.max_children = 10
344242
345243This configuration starts with 10 processes.
346244
347- In dynamic mode, PHP-FPM starts at *most* the number of processes specified by the` pm.max_children` value. It first starts some processes corresponding to `pm.start_servers`, keeping at least the value of `pm.min_spare_servers` of inactive processes and, at most, `pm.max_spare_servers` of inactive processes.
245+ In dynamic mode, PHP-FPM starts at *most* the number of processes specified by the`pm.max_children` value. It first starts some processes corresponding to `pm.start_servers`, keeping at least the value of `pm.min_spare_servers` of inactive processes and, at most, `pm.max_spare_servers` of inactive processes.
348246
349247Example :
350248
0 commit comments