You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
contributors: Steven Spencer, Ganna Zhyrnova, Joseph Brinkman
5
+
tested_with: 9.3, 8.9
6
6
tags:
7
7
- web
8
8
- php
@@ -11,11 +11,7 @@ tags:
11
11
12
12
# PHP and PHP-FPM
13
13
14
-
!!! warning "Written for Rocky Linux 8.x"
15
-
16
-
This procedure was initially published when Rocky Linux 8.x was the only version. This procedure must tested and rewritten for Rocky Linux 9.x.
17
-
18
-
**PHP** (**P**HP **H**ypertext **P**reprocessor) is a source scripting language, specially designed for web application development. In 2021, PHP represented a little less than 80% of the web pages generated in the world. PHP is open-source and is the core of the most famous CMS (WordPress, Drupal, Joomla!, Magento, ...).
14
+
**PHP** (**P**HP **H**ypertext **P**reprocessor) is a source scripting language, specially designed for web application development. In 2024, PHP represented a little less than 80% of the web pages generated in the world. PHP is open-source and is the core of the most famous CMS (WordPress, Drupal, Joomla!, Magento, ...).
19
15
20
16
**PHP-FPM** (**F**astCGI **P**rocess **M**anager) is integrated to PHP since its version 5.3.3. The FastCGI version of PHP brings additional functionalities.
21
17
@@ -43,46 +39,80 @@ Rocky Linux, like its upstream, offers many versions of the language. Some of th
43
39
44
40
To obtain a list of available versions, simply enter the following command:
45
41
46
-
```bash
47
-
$ sudo dnf module list php
42
+
=== "9.3 PHP module list"
48
43
49
-
Rocky Linux 8 - AppStream
50
-
Name Stream Profiles Summary
51
-
php 7.2 [d] common [d], devel, minimal PHP scripting language
52
-
php 7.3 common [d], devel, minimal PHP scripting language
53
-
php 7.4 common [d], devel, minimal PHP scripting language
54
-
php 8.0 common [d], devel, minimal PHP scripting language
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:
with Zend OPcache v7.4.19, Copyright (c), by Zend Technologies
186
+
```
112
187
113
188
### Configuration
114
189
@@ -118,24 +193,23 @@ To serve PHP pages in CGI mode, you must install the apache server, configure it
118
193
119
194
* Installation:
120
195
121
-
```bash
122
-
sudo dnf install httpd
123
-
```
196
+
```bash
197
+
sudo dnf install httpd
198
+
```
124
199
125
-
* Activation:
200
+
* Activation:
126
201
127
-
```bash
128
-
sudo systemctl enable httpd
129
-
sudo systemctl start httpd
130
-
sudo systemctl status httpd
131
-
```
202
+
```bash
203
+
sudo systemctl enable --now httpd
204
+
sudo systemctl status httpd
205
+
```
132
206
133
207
* Don't forget to configure the firewall:
134
208
135
-
```bash
136
-
sudo firewall-cmd --add-service=http --permanent
137
-
sudo firewall-cmd --reload
138
-
```
209
+
```bash
210
+
sudo firewall-cmd --add-service=http --permanent
211
+
sudo firewall-cmd --reload
212
+
```
139
213
140
214
The default vhost should work out of the box. PHP provides a `phpinfo()` function that generates a summary table of its configuration. It's very useful to test the good working of PHP. However, be careful not to leave such test files on your servers. They represent a huge security risk for your infrastructure.
141
215
@@ -168,8 +242,7 @@ sudo dnf install php-fpm
168
242
As php-fpm is a service from a system point of view, it must be activated and started:
169
243
170
244
```bash
171
-
sudo systemctl enable php-fpm
172
-
sudo systemctl start php-fpm
245
+
sudo systemctl enable --now php-fpm
173
246
sudo systemctl status php-fpm
174
247
```
175
248
@@ -189,7 +262,7 @@ daemonize = yes
189
262
190
263
The php-fpm configuration files are widely commented. Go and have a look!
191
264
192
-
As you can see, the files in the `/etc/php-fpm/` directory with the `.conf` extension are always included.
265
+
As you can see, the files in the `/etc/php-fpm.d/` directory with the `.conf` extension are always included.
193
266
194
267
By default, a PHP process pool, named `www`, is declared in `/etc/php-fpm.d/www.conf`.
0 commit comments