Install PHP 8 on Fedora 35 - Step by step guide ?

This article covers the steps to install PHP 8 on your Fedora 35 system. In fact, PHP 8.1 is a significant update of the PHP language that will be "officially" released on November 25, 2021. Note that you may find that many of your favorite software like WordPress or Plugins / Themes for CMS software may conflict until developers can update.

 

About PHP-FPM Installations of PHP 8.1

1. Firstly, open following (www.conf) configuration file:

$ sudo nano /etc/php-fpm.d/www.conf

2. Next, replace the (Apache) user and group with the (Nginx) user and group.

3. To save, press (CTRL+O) then exit (CTRL+X).

4. Now you will too reload or restart your PHP-FPM service:

$ sudo systemctl restart php-fpm

5. The Nginx server block needs the following example below for Nginx to process the PHP files:

server {
 # … some other code
 # Pass the php scripts to FastCGI server specified in upstream declaration.
location ~ \.php(/|$) {
include fastcgi.conf;
                fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /app.php$is_args$args;
fastcgi_intercept_errors on;
}
}

6. Test Nginx to make sure you have no errors with the adjustments made with the code above; enter the following:

$ sudo nginx -t

7. Finally, Restart Nginx service for installation to be complete:

$ sudo systemctl restart nginx

 



icon

Sign up to our Newsletter

...and get one free support ticket.