AlmaLinux

Install PHP 8.6 on Rocky Linux 10 / 9 and AlmaLinux 10 / 9

PHP 8.6 is out, and on Rocky Linux and AlmaLinux the shortest way onto it is still Remi’s modular repository. Enable one stream, install the packages, and PHP-FPM answers behind Nginx or Apache with SELinux left enforcing. The one setting that broke on us was the opcache JIT, which took PHP-FPM down with a 502 until we flipped a single SELinux boolean.

Original content from computingforgeeks.com - post 158898

We spread the commands across Rocky Linux 10.2, AlmaLinux 10.3, Rocky Linux 9.8 and AlmaLinux 9.9 in November 2026, against PHP 8.6.0 from Remi with SELinux enforcing on all four. Use the module stream when a server runs one PHP, and keep the side-by-side packages for hosts where you need two versions at once. Start from a patched minimal install, ideally one prepared the way our post-install checklist for Rocky Linux 10 and AlmaLinux 10 describes.

What changes in PHP 8.6 for server admins

Most of the release is language work for developers, but a few items change what you see on a server. These are the ones that matter when you upgrade a host, taken from the official PHP 8.6 migration guide:

  • Partial function application with ? and ... placeholders
  • A built-in clamp() function
  • The Time\Duration class for timeouts with nanosecond precision
  • is_integer(), is_long(), is_double() and doubleval() deprecated
  • trim(), ltrim() and rtrim() now strip form feed by default
  • Session defaults: strict mode and HttpOnly on, SameSite set to Lax

The deprecations are the part you’ll notice first, because old code keeps running but fills your FPM error log once E_DEPRECATED is reported. The session change is the one most likely to break a working site. With SameSite at Lax, the session cookie no longer rides on cross-site POST requests, so SSO and payment callbacks that POST back to your app can arrive logged out; such apps must set session.cookie_samesite to None with session.cookie_secure = 1. Strict mode also rejects session IDs a custom handler accepts from outside, and HttpOnly hides the cookie from JavaScript, so check apps that do either. If you tune memory limits for your FPM pools during the upgrade, our memory_hard_limit_percent explainer covers the hard ceiling that can kill a worker outright. If you are staying on an older branch for now, our guide to checking and patching the November PHP CVEs shows which builds carry the fixes.

Add EPEL and the Remi repository

Remi’s packages pull a few libraries from EPEL (libsodium, libavif and the image codecs behind php-gd), and EPEL in turn needs CRB enabled. Install all three before you touch the PHP module, otherwise the install step fails on missing dependencies. On Enterprise Linux 10, run:

sudo dnf install -y epel-release
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-10.rpm
sudo dnf config-manager --set-enabled crb

On Enterprise Linux 9 the only change is the release package: swap remi-release-10.rpm for remi-release-9.rpm. Our Remi repository guide for Rocky, AlmaLinux and RHEL covers the RHEL subscription variant. Check that both Remi repositories are now listed:

sudo dnf repolist

You should see remi-modular and remi-safe next to the distribution repositories, EPEL and CRB:

repo id               repo name
appstream             Rocky Linux 10 - AppStream
baseos                Rocky Linux 10 - BaseOS
crb                   Rocky Linux 10 - CRB
epel                  Extra Packages for Enterprise Linux 10 - x86_64
extras                Rocky Linux 10 - Extras
remi-modular          Remi's Modular repository for Enterprise Linux 10 - x86_64
remi-safe             Safe Remi's RPM repository for Enterprise Linux 10 - x86_64

remi-modular carries the stream that replaces the system php packages, while remi-safe holds the side-by-side php85 and php86 collections we’ll use later. Neither one overrides anything until you enable a stream.

Enable the remi-8.6 module stream

List the PHP streams first so you know what the repositories offer and whether anything is already enabled. A stream someone enabled months ago wins over anything you install today, so it pays to look before you change it.

sudo dnf module list php

On Rocky Linux 10 the only PHP streams come from Remi, from remi-7.4 up to remi-8.6. DNF also prints a warning that modularity is deprecated. It is only a warning, because module streams still work on Enterprise Linux 10 and Remi still ships PHP this way, so you can ignore it for now.

dnf module list php on Rocky Linux 10 showing Remi streams remi-7.4 to remi-8.6

Enterprise Linux 9 is different: AppStream carries its own php streams (8.1 to 8.4 on Rocky Linux 9.8), listed above Remi’s. This is the same command on Rocky Linux 9, with the repository download lines trimmed:

Rocky Linux 9 - AppStream
Name Stream   Profiles                   Summary
php  8.1      common [d], devel, minimal PHP scripting language
php  8.2      common [d], devel, minimal PHP scripting language
php  8.3      common [d], devel, minimal PHP scripting language
php  8.4      common, devel, minimal     PHP scripting language

Remi's Modular repository for Enterprise Linux 9 - x86_64
Name Stream   Profiles                   Summary
php  remi-7.4 common [d], devel, minimal PHP scripting language
php  remi-8.0 common [d], devel, minimal PHP scripting language
php  remi-8.1 common [d], devel, minimal PHP scripting language
php  remi-8.2 common [d], devel, minimal PHP scripting language
php  remi-8.3 common [d], devel, minimal PHP scripting language
php  remi-8.4 common [d], devel, minimal PHP scripting language
php  remi-8.5 common [d], devel, minimal PHP scripting language
php  remi-8.6 common [d], devel, minimal PHP scripting language

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

That is why the reset below matters on Enterprise Linux 9, since a stream enabled earlier by another guide or a panel installer blocks the switch. Reset and enable on both major versions:

sudo dnf module reset -y php
sudo dnf module enable -y php:remi-8.6

Confirm the stream carries the [e] flag before you install anything. If the reset was skipped and an AppStream stream is still active, the install would quietly pull the older PHP, so this check saves you an uninstall later.

sudo dnf module list --enabled php

Only one line should come back, and it should read remi-8.6 [e]. Two enabled lines mean the reset did not run.

Remi's Modular repository for Enterprise Linux 10 - x86_64
Name Stream       Profiles                   Summary
php  remi-8.6 [e] common [d], devel, minimal PHP scripting language

With the stream enabled, every php-* package you install or update from here on resolves to the 8.6 builds, and the AppStream or older Remi builds are hidden.

Install PHP 8.6 with common extensions

This set covers what WordPress, Laravel and most PHP applications ask for: both database drivers, GD, intl, mbstring, XML, zip, bcmath, sodium and the Redis client. OPcache does not need its own package any more, because the 8.6 stream has no php-opcache and the extension loads from the packages above. So an old install script that names php-opcache is worth checking before you reuse it.

sudo dnf install -y php php-fpm php-cli php-common php-mysqlnd php-pgsql php-gd php-mbstring php-xml php-intl php-zip php-bcmath php-sodium php-pecl-redis

On Rocky Linux 10 that came to 55 packages and 38 MB. Rocky Linux 9 pulled 65 packages and 42 MB, because more libraries come from outside the base image. Two things in the transaction are worth knowing before you read it.

  • php-pecl-redis resolves to php-pecl-redis6
  • The php package pulls in httpd-core, even on an Nginx host

Leave httpd-core installed. Removing it removes PHP too, and our Nginx host ran with it in place and no Apache service enabled, so it costs you nothing but disk.

Installing:
 php                       x86_64  8.6.0-1.module_php.8.6.el10.remi      remi-modular  3.2 M
 php-cli                   x86_64  8.6.0-1.module_php.8.6.el10.remi      remi-modular  6.5 M
 php-fpm                   x86_64  8.6.0-1.module_php.8.6.el10.remi      remi-modular  3.3 M
 php-pecl-redis6           x86_64  6.3.0-4.module_php.8.6.el10.remi      remi-modular  278 k
...
Transaction Summary
============================================================================================
Install  55 Packages

Total download size: 38 M

Check the CLI binary and the extensions it loaded. The CLI and FPM read the same /etc/php.d files, so a module that loads here also loads for web requests.

php -v
php -m | wc -l

The banner names Remi’s build and the Zend Engine that ships with this release, and the count came to 59 lines on every host we built, which is 54 modules once you drop the section headers, blank lines and the second OPcache entry. Two of those are new: lexbor and uri, which back the standards-compliant URL parser that arrived in the previous release.

php -v showing PHP 8.6.0 from Remi with the remi-8.6 stream enabled on Rocky Linux 10

Rocky Linux 9 and AlmaLinux 10 printed the same build line, down to the timestamp, so one set of steps works on both major versions. That matters when you run a mixed fleet, because the same PHP build means the same extension list and the same bugs on every host. Only the release package and the package count differed.

Start PHP-FPM and check the socket

PHP-FPM is what Nginx and Apache hand PHP requests to. Enable it now so it comes back after a reboot:

sudo systemctl enable --now php-fpm
systemctl status php-fpm --no-pager

Look for active (running), the status line Ready to handle connections and five pool www workers under the master process:

systemctl status php-fpm active with five pool www workers and the www.sock socket SELinux label

The default pool listens on a Unix socket, and its permissions explain why both web servers can use it without edits. The pool runs as apache, the socket is owned by root with mode 0660, and an ACL grants apache and nginx access (that’s the + after the mode). The SELinux label is httpd_var_run_t, and Apache and Nginx both run in the httpd_t domain, which may connect to it.

srw-rw----+ 1 root root system_u:object_r:httpd_var_run_t:s0 0 Nov 20 23:38 /run/php-fpm/www.sock
user = apache
group = apache
listen = /run/php-fpm/www.sock
listen.acl_users = apache,nginx
listen.allowed_clients = 127.0.0.1

Resist the urge to change user = apache to nginx on an Nginx host. The session directory /var/lib/php/session is group-owned by apache, so switching the pool user breaks PHP sessions and logins with a permission error. If you need pool tuning, edit /etc/php-fpm.d/www.conf and restart php-fpm.

Serve PHP through Nginx

Pick one web server per host. This section and the Apache one are alternatives, because both stock configs listen on port 80 and the second service fails to start if the first is running. We built the Nginx path on Rocky Linux 10 and the Apache path on a separate AlmaLinux 10 host.

Install Nginx from AppStream. The AppStream build we got on Rocky Linux 10 did not yet carry the November HTTP/2 fix. The stock server block is plain HTTP on port 80 without HTTP/2, so it is safe as installed, but read our nginx CVE-2026-123007 check and patch guide before you add TLS and HTTP/2.

sudo dnf install -y nginx

You do not have to write a PHP location block for the default site, because the php-fpm package already ships one. It drops an upstream named php-fpm into conf.d and a location ~ \.php$ block into default.d, which the stock server block in nginx.conf includes. List the files it owns to see them:

rpm -ql php-fpm | grep nginx

The first two are the upstream and the location block. The third file is a systemd drop-in that makes Nginx start after PHP-FPM, so the socket exists before the first request arrives after a reboot.

/etc/nginx/conf.d/php-fpm.conf
/etc/nginx/default.d/php.conf
/usr/lib/systemd/system/nginx.service.d/php-fpm.conf

For your own virtual host, copy the same location block into its server { } section and point fastcgi_pass at the php-fpm upstream. This is the block exactly as the package installs it.

index index.php index.html index.htm;
location ~ \.php$ {
    try_files $uri =404;
    fastcgi_intercept_errors on;
    fastcgi_index  index.php;
    include        fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_pass   php-fpm;
}

The try_files $uri =404 line is the one to keep in any copy, because it stops Nginx from handing a nonexistent path to PHP. Test the configuration, start Nginx and drop two test scripts into the default web root:

sudo nginx -t
sudo systemctl enable --now nginx
echo '<?php phpinfo();' | sudo tee /usr/share/nginx/html/info.php
echo '<?php echo PHP_VERSION, " ", PHP_SAPI, "\n";' | sudo tee /usr/share/nginx/html/v.php

Now request the version script through Nginx and search the audit log for denials. Run both even when the page loads, because a denial can break one path while another still works.

curl -s http://localhost/v.php
sudo ausearch -m AVC -ts recent

fpm-fcgi in the reply proves the request went through PHP-FPM and not the CLI, and an empty AVC search proves SELinux did not block anything along the way.

nginx -t passes and curl v.php returns 8.6.0 fpm-fcgi with no SELinux AVC denials

The phpinfo page in a browser shows the same thing in more detail: Server API FPM/FastCGI and /etc/php.ini as the loaded configuration file.

phpinfo page for PHP 8.6.0 served by Nginx with Server API FPM/FastCGI on Rocky Linux 10

Delete info.php once you’ve seen it, since it lists every path and setting on the server to anyone who asks. Keep v.php for now, because the upgrade check below reuses it. Remove it too before the host takes real traffic.

Serve PHP through Apache

Apache works the same way, through mod_proxy_fcgi to the same socket, and the packages wire it up for you. We tested this path on AlmaLinux 10 with PHP installed exactly as above. Install httpd:

sudo dnf install -y httpd

Remi’s packages already put /etc/httpd/conf.d/php.conf in place. Because no mod_php is loaded, its fallback block hands every .php and .phar file to PHP-FPM, and it passes the Authorization header through so API tokens and basic auth reach your app:

# Redirect to local php-fpm if mod_php (5 or 7) is not available
<IfModule !mod_php5.c>
  <IfModule !mod_php7.c>
    <IfModule !mod_php.c>
      # Enable http authorization headers
      SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1

      <FilesMatch \.(php|phar)$>
          SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
      </FilesMatch>
    </IfModule>
  </IfModule>
</IfModule>

The same file also blocks web access to .user.ini and adds index.php to DirectoryIndex. So there is nothing to edit for the default site. Start both services and drop the same two test scripts into Apache’s web root.

sudo systemctl enable --now httpd php-fpm
echo '<?php phpinfo();' | sudo tee /var/www/html/info.php
echo '<?php echo PHP_VERSION, " ", PHP_SAPI, "\n";' | sudo tee /var/www/html/v.php

Request the version script and check which modules handle it. The AVC search matters here too, because SELinux denials land in the audit log, not on the error page Apache returns.

curl -s http://localhost/v.php
httpd -M | grep -E 'proxy_fcgi|mpm'
sudo ausearch -m AVC -ts recent

The reply is fpm-fcgi again, Apache runs the event MPM with proxy_fcgi_module loaded, and SELinux logged no denials. The AH00558 line about the server name is harmless; set ServerName in /etc/httpd/conf/httpd.conf to silence it.

Apache with mpm_event and proxy_fcgi serving PHP 8.6 through PHP-FPM on AlmaLinux 10

Event MPM plus PHP-FPM is the setup you want on Apache, since the prefork MPM that mod_php needs holds a whole process per connection. A stock httpd install already runs event, and the fpm-fcgi reply confirms PHP-FPM is doing the work, so there is nothing to switch.

Open HTTP and HTTPS in firewalld

Rocky Linux and AlmaLinux images normally ship firewalld, but minimal and cloud images sometimes leave it out, so install it if needed and allow the two web services:

sudo dnf install -y firewalld
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service={http,https}
sudo firewall-cmd --reload
sudo firewall-cmd --list-services

The last command should print http https in its list. Leave the PHP-FPM socket alone. It is a local Unix socket, so it never needs a firewall rule unless you later move FPM to a TCP port on another host.

Turn on the opcache JIT without breaking SELinux

PHP 8.6 from Remi starts with the JIT switched off. opcache.jit reads disable, and the 64 MB opcache.jit_buffer_size setting does nothing until you turn it on. That default is the right call for most web apps, which spend their time waiting on the database, not in PHP. If you run CPU-heavy PHP (image work, parsers, long loops), you’ll want the JIT, and this is where SELinux gets in the way. We enabled tracing mode in a drop-in file and restarted PHP-FPM:

printf 'opcache.jit=tracing\nopcache.jit_buffer_size=64M\n' | sudo tee /etc/php.d/99-jit.ini
sudo systemctl restart php-fpm

The restart failed, every PHP page returned 502, and the FPM error log said nothing useful. The journal had the real error, Fatal Error mprotect() failed [13] Permission denied, and the audit log had the matching avc: denied { execmem } for php-fpm in the httpd_t domain. The JIT needs memory that is both writable and executable, and the targeted policy denies that to web server processes by default. One persistent boolean allows it:

sudo setsebool -P httpd_execmem on
sudo systemctl restart php-fpm

The whole sequence from the lab shows the failure first, then the boolean and a 200.

PHP-FPM fails with mprotect Permission denied and 502 until setsebool httpd_execmem on

Weigh it before you flip it. httpd_execmem applies to every process in the httpd_t domain, Apache and Nginx included, so a compromised worker gets writable executable memory too. Do not run setenforce 0 to make the 502 go away, because that switches off every other SELinux protection on the host to fix a problem one boolean solves. We left the JIT off on the lab servers after this test, removed the drop-in and turned the boolean back off.

Smoke test partial functions, clamp() and Duration

A short script that only runs on this release is the quickest way to prove the right binary answers, and it shows the three features you’re most likely to use. Create it in your home directory:

vim ~/smoke86.php

Paste in the following. Each line prints a label first, so you can tell at a glance which feature failed if one does.

<?php
use Time\Duration;

echo "clamp: ", clamp(15, 0, 10), " ", clamp(-3, 0, 10), " ", clamp(2.5, 1, 3), "\n";

$f = str_replace("a", "b", ?);
echo "pfa: ", $f("banana"), "\n";

$d = Duration::fromMinutes(90);
echo "duration: ", $d->seconds, "s negative=", var_export($d->negative, true), "\n";
$sum = $d->add(Duration::fromSeconds(30, 500));
echo "sum: ", $sum->seconds, "s ", $sum->nanoseconds, "ns\n";
echo "compare: ", Duration::compare($d, $sum), "\n";
echo "iso: ", Duration::fromIso8601DurationString("PT1H30M")->seconds, "\n";

echo "first/last: ", array_first([3, 4, 5]), " ", array_last([3, 4, 5]), "\n";

str_replace("a", "b", ?) doesn’t call anything; it returns a closure with the subject left open, which is what partial function application means. clamp() pins a value between a minimum and a maximum, and Duration holds seconds plus nanoseconds without the float rounding you get from microtime() arithmetic. Run it:

php ~/smoke86.php

Every line matched what the manual says it should return. Ninety minutes is 5400 seconds, adding 30 seconds and 500 nanoseconds keeps the nanoseconds separate, and the ISO 8601 string PT1H30M parses to the same 5400:

PHP 8.6 smoke test output for clamp, partial function application and Time Duration

On any older PHP the same file dies at parse time on the ? placeholder, so it doubles as a check that a deploy really landed on the new runtime. Placeholders also combine with the pipe operator: " Hello World " |> trim(...) |> strtolower(...) returned hello world in the lab, and strlen(?) came back as a plain Closure.

Upgrade from PHP 8.5 to 8.6 in place

If the server already runs the remi-8.5 stream, you do not need to remove anything. We built an AlmaLinux 9 host the way our PHP 8.5 guide for Rocky Linux and AlmaLinux does, with the same extensions, PHP-FPM and Nginx, then switched it. Switching back to remi-8.5 is possible, but a rollback is not guaranteed to be clean once packages have been renamed, so do three things before you start.

  • Run your application’s test suite against the new release on another host
  • Take a snapshot or backup of the server
  • Note which php-pecl-* packages are installed, since one may be renamed

One command then moves the stream and upgrades every installed PHP package in a single transaction.

sudo dnf module switch-to -y php:remi-8.6

Read the transaction before you trust it, because one package changes name. php-pecl-zip from the 8.5 stream has no 8.6 build, and DNF replaced it with php-zip, which is versioned with PHP itself; the other 16 packages upgraded in place:

No packages available to distrosync for package name 'php-pecl-zip'
Dependencies resolved.
================================================================================
 Package           Arch   Version                            Repository    Size
================================================================================
Installing:
 php-zip           x86_64 8.6.0-1.module_php.8.6.el9.remi    remi-modular  49 k
     replacing  php-pecl-zip.x86_64 1.22.8-1.module_php.8.5.el9.remi
Upgrading:
 php               x86_64 8.6.0-1.module_php.8.6.el9.remi    remi-modular 3.2 M
 php-cli           x86_64 8.6.0-1.module_php.8.6.el9.remi    remi-modular 6.6 M
 php-fpm           x86_64 8.6.0-1.module_php.8.6.el9.remi    remi-modular 3.3 M
...
Switching module streams:
 php                      remi-8.5 -> remi-8.6

Transaction Summary
================================================================================
Install   1 Package
Upgrade  16 Packages

The “No packages available to distrosync” line looks like an error, but it only means DNF found the replacement through the obsoletes path instead. The switch took almost six minutes on our host, mostly spent on Waiting for process with pid 3496 to finish while another process held the package lock, so the switch itself is a short job on a quiet server.

You don’t have to restart PHP-FPM yourself, because the upgrade does it: the master PID changed from 4113 to 21445 at the moment the transaction finished, and the version script answered from the new runtime straight away. Check it on your own host:

systemctl show -p MainPID -p ActiveEnterTimestamp php-fpm
curl -s http://localhost/v.php
sudo find /etc -name '*.rpmnew' -newer /etc/hostname

The -newer /etc/hostname test roughly limits the search to files written after the host was built. If v.php is missing because your 8.5 host was set up another way, create it with the same one-line tee from the Nginx or Apache section first. The find came back empty in the lab, which means no config file needed a manual merge. That cuts both ways for php.ini. Ours was unedited, so RPM swapped in the 8.6 copy and the new session defaults took effect at once. On a host where you edited php.ini, your file stays and the new one lands as php.ini.rpmnew, so the old session values stay in force until you merge. If it lists files on your host, run diff on each one against its live copy, because the new defaults only apply once you merge them. The screenshot shows the PID change and the version check from the lab.

After dnf module switch-to, PHP-FPM restarted on its own and serves PHP 8.6.0 on AlmaLinux 9

Now look for the code that the release deprecates. Create a test script in your home directory that calls the four aliases:

vim ~/deprecated.php

It needs only two lines. Each call is one of the deprecated aliases, so every notice you see later maps to a line you can read here.

<?php
var_dump(is_integer(5), is_long(5), is_double(1.5), doubleval("3.14"));

Copy it into the web root with a readable mode, then run it once through the CLI with every error shown and once through PHP-FPM. The two runs use different error_reporting values, so comparing them shows what production would log. On an Apache host, use /var/www/html in both the cp and chmod lines.

sudo cp ~/deprecated.php /usr/share/nginx/html/deprecated.php
sudo chmod 644 /usr/share/nginx/html/deprecated.php
php -d error_reporting=E_ALL -d display_errors=1 ~/deprecated.php
curl -s http://localhost/deprecated.php

We ran the same pair before the switch, and on 8.5 the CLI printed only the four results, even with error_reporting=E_ALL. After the switch, the same file raises one notice per call and names the replacement for each. A stock install also copies each notice to stderr as a “PHP Deprecated:” line, so you see them twice; our capture hid that copy with 2>/dev/null.

PHP 8.6 deprecation notices for is_integer, is_long, is_double and doubleval

Through PHP-FPM, though, the page returned the same output and the pool’s error log was not even created, because the production error_reporting excludes deprecations. That silence keeps old code running quietly, which is exactly why you go looking for it before the aliases are removed. To find the calls on a live site, raise reporting for the pool only:

echo 'php_admin_value[error_reporting] = E_ALL' | sudo tee /etc/php-fpm.d/zz-errors.conf
sudo systemctl restart php-fpm

Load the pages you care about, then read /var/log/php-fpm/www-error.log. Each line names the function, the replacement and the file and line to change, so you get a work list rather than a guess. Cron jobs and queue workers run through the CLI, so check those with php -d error_reporting=E_ALL as well.

PHP-FPM www-error.log listing PHP Deprecated lines after raising error_reporting for the pool

Fixing these is a search and replace in your code: is_int(), is_float() and floatval() have existed for years, so the patched code still runs on older PHP. When the log stays quiet, remove zz-errors.conf and restart php-fpm again so production goes back to its normal logging level.

Run PHP 8.5 next to 8.6 with Software Collections

A module stream gives you one PHP per server. When one app is ready for the new release and another isn’t, install the older version as a Software Collection from remi-safe instead. Collections live under /opt/remi, get their own binary and their own FPM service, and never touch the system php. Both collections were in the repository on Rocky Linux 10:

sudo dnf list --available 'php85-php-cli' 'php86-php-cli' 'php85-php-fpm'

The collection packages carry their own version numbers, separate from the module build. Because they install under /opt/remi with a php85- prefix, nothing in this list conflicts with the PHP you already have.

Available Packages
php85-php-cli.x86_64                8.5.13-1.el10.remi                 remi-safe
php85-php-fpm.x86_64                8.5.13-1.el10.remi                 remi-safe
php86-php-cli.x86_64                8.6.0-1.el10.remi                  remi-safe

Install the older CLI and FPM next to the module build, then enable its service. Add the collection’s extensions the same way (php85-php-mysqlnd and so on), because it does not see anything installed for the module build.

sudo dnf install -y php85-php-cli php85-php-fpm
sudo systemctl enable --now php85-php-fpm

Check both versions and both FPM services. php85 is the collection’s wrapper, and plain php stays on the module build:

php85 -v
php -v | head -1
systemctl is-active php-fpm php85-php-fpm

Two PHP binaries now answer on the same host, each with its own FPM master running. Updates stay separate too, so a dnf upgrade moves each build along its own branch and never swaps one for the other.

php85 Software Collection running next to PHP 8.6 with both PHP-FPM services active

Each FPM listens on its own socket, both labelled httpd_var_run_t, so SELinux needs no extra rules. The collection keeps its pieces apart from the module build.

  • Binary wrapper php85
  • Service php85-php-fpm
  • Socket /var/opt/remi/php85/run/php-fpm/www.sock
  • Pool file /etc/opt/remi/php85/php-fpm.d/www.conf

Point the older app’s Nginx fastcgi_pass or Apache SetHandler at that socket. One difference from the module pool caught our eye, because the collection sets listen.acl_users = apache only. The socket is 0660 root with no other way in, so on an Nginx host you change that line to apache,nginx and restart php85-php-fpm.

Fix common PHP 8.6 errors on Rocky and AlmaLinux

All of these came up while building the lab servers.

“Access denied.” and “Failed to open stream: Permission denied”

We copied a test script into the web root with sudo cp from a file created with a tight umask, and Nginx returned the bare text Access denied.. The FPM pool log at /var/log/php-fpm/www-error.log had the cause:

[20-Nov-2026 23:43:39 UTC] PHP Warning:  PHP Request Startup: Failed to open stream: Permission denied in Unknown on line 0

The file was -rw------- root, and the pool runs as apache, so PHP could not read the script it was asked to run. sudo chmod 644 on the file fixed it. If the mode is fine and the error stays, check the label with ls -Z: a file moved with mv from your home directory keeps user_home_t, and sudo restorecon -v on it puts back httpd_sys_content_t.

“Fatal Error mprotect() failed [13] Permission denied”

PHP-FPM refuses to start and Nginx answers 502. This is the JIT meeting SELinux, covered in the JIT section above: set httpd_execmem on, or set opcache.jit=disable again and restart. sudo ausearch -m AVC -ts recent shows the execmem denial if you need proof before changing anything.

Deprecation notices appear in the CLI but not in the FPM log

Remi’s php.ini sets error_reporting to 22527, the production value that leaves out E_DEPRECATED, with display_errors off. So a web request through FPM logs nothing for is_long(), while php -d error_reporting=E_ALL on the CLI shows every notice. To audit a site before an upgrade, raise it for the pool only with php_admin_value[error_reporting] = E_ALL in a file under /etc/php-fpm.d/, restart php-fpm, browse the site, and then remove the file. The upgrade section shows the log lines that produced in the lab.

“WARNING: modularity is deprecated” on every dnf module command

Enterprise Linux 10 prints this on every dnf module call. Nothing is broken: module streams still install and update normally, and Remi still publishes PHP through them. If a future DNF release drops modularity entirely, the side-by-side php86 packages from remi-safe are the route that does not depend on it.

Keep reading

PHP2Shell (CVE-2026-109618, CVE-2026-109619): Check and Patch PHP Php PHP2Shell (CVE-2026-109618, CVE-2026-109619): Check and Patch PHP PHP2Shell and CVE-2026-115560 on EOL PHP 8.1, 8.0 and 7.4 Php PHP2Shell and CVE-2026-115560 on EOL PHP 8.1, 8.0 and 7.4 Install GitHub CLI (gh) on Linux, macOS, and Windows Programming Install GitHub CLI (gh) on Linux, macOS, and Windows ty Python Type Checker: Install and Benchmark vs mypy, Pyright Programming ty Python Type Checker: Install and Benchmark vs mypy, Pyright Python CVE-2026-19445: Check and Patch the sni_callback Flaw Programming Python CVE-2026-19445: Check and Patch the sni_callback Flaw Install GitHub Desktop on Rocky / CentOS / AlmaLinux CentOS Install GitHub Desktop on Rocky / CentOS / AlmaLinux

Leave a Comment

Press ESC to close