Install PHP 7.4 & 8.1 but can not start php-fpm server

It seems like you have uninstalled it. As I said, the package name will be php or php<version>-php or rh-php<version>-php. If you don’t have that, you don’t have mod_php installed.

It doesn’t install automatically. You had to have explicitly installed it (or you installed Virtualmin on this system several years ago before the Virtualmin 6 installer removed mod_php from the default set of dependencies). So, just don’t do that again.

You definitely should not run insecure versions.

The PHP 5 version included with CentOS is maintained by the RHEL/CentOS folks. You should be able to safely use it through the life of the distro, as long as you’re up to date with CentOS updates.

The others are much less actively maintained, and you have to be much more aware of what you’re running, and keep on top of security issues that may be present in them.

This is why I generally recommend people stick with their OS-provided packages whenever possible. All the third party and extra repos are lightly maintained by volunteers. They are not at the same level of quality assurance as packages included with the distro. Thus, if you need newer packages, you should be using a newer distro (RHEL or Alma or Rocky 8 would be the obvious choice for someone familiar with CentOS).

2 Likes

Thank you, I didn’t know that PHP5 maintained by Centos7 was secure.

Right now I have a Virtualmin in tests running under AlmaLinux to prepare the migration, I had some problems in the installation but everything is working, I’ll wait patiently for version 7 to start migrating things.

One last thing about the PHP installation, curiously now I’m running PHP-FPM server in version 8.1, but not in 7.4 or 7.3 and even in 8.0, it does not let me lift the service, curiously I see that I have installed in version 7.3 from the repository of Centos rh-php73* and version 7.3 (and the rest 7.4, 8 and 8.1) from the repository of @remi-safe I comment it because I do not know if it can affect the failure.
Indeed it is a server that was installed several years ago, perhaps even with version 4 of Virtualmin, maybe that’s why mod_php …

In fact these are the repositories that I have activated, I do not know if there is any that you recommend me to remove or add … ??

[root@hosting ~]# yum repolist
Complementos cargados:fastestmirror
Determining fastest mirrors
epel/x86_64/metalink                                                                               |  20 kB  00:00:00
 * base: mirror.uv.es
 * centos-sclo-rh: mirror.uv.es
 * centos-sclo-sclo: mirror.uv.es
 * epel: mirror.imt-systems.com
 * extras: mirror.uv.es
 * remi-safe: remi.mirrors.cu.be
 * updates: mirror.uv.es
 * webtatic: uk.repo.webtatic.com
Webmin                                                                                             | 2.9 kB  00:00:00
base                                                                                               | 3.6 kB  00:00:00
centos-sclo-rh                                                                                     | 3.0 kB  00:00:00
centos-sclo-sclo                                                                                   | 3.0 kB  00:00:00
epel                                                                                               | 4.7 kB  00:00:00
extras                                                                                             | 2.9 kB  00:00:00
mariadb                                                                                            | 3.4 kB  00:00:00
remi-safe                                                                                          | 3.0 kB  00:00:00
updates                                                                                            | 2.9 kB  00:00:00
virtualmin                                                                                         | 2.5 kB  00:00:00
virtualmin-universal                                                                               | 2.5 kB  00:00:00
webtatic                                                                                           | 3.6 kB  00:00:00
(1/17): base/7/x86_64/group_gz                                                                     | 153 kB  00:00:00
(2/17): centos-sclo-sclo/x86_64/primary_db                                                         | 300 kB  00:00:00
(3/17): centos-sclo-rh/x86_64/primary_db                                                           | 3.3 MB  00:00:00
(4/17): base/7/x86_64/primary_db                                                                   | 6.1 MB  00:00:00
(5/17): epel/x86_64/group_gz                                                                       |  96 kB  00:00:00
(6/17): epel/x86_64/updateinfo                                                                     | 1.0 MB  00:00:00
(7/17): extras/7/x86_64/primary_db                                                                 | 246 kB  00:00:00
(8/17): epel/x86_64/primary_db                                                                     | 7.0 MB  00:00:00
(9/17): mariadb/updateinfo                                                                         | 5.8 kB  00:00:00
(10/17): mariadb/primary_db                                                                        |  59 kB  00:00:00
(11/17): virtualmin/7/x86_64/primary_db                                                            |  99 kB  00:00:00
(12/17): updates/7/x86_64/primary_db                                                               |  15 MB  00:00:00
(13/17): virtualmin-universal/primary_db                                                           |  82 kB  00:00:00
(14/17): remi-safe/primary_db                                                                      | 2.1 MB  00:00:00
(15/17): Webmin/primary_db                                                                         | 172 kB  00:00:02
(16/17): webtatic/x86_64/group_gz                                                                  |  448 B  00:00:00
(17/17): webtatic/x86_64/primary_db                                                                | 271 kB  00:00:00
id del repositorio                      nombre del repositorio                                                      estado
Webmin                                  Webmin Distribution Neutral                                                    206
base/7/x86_64                           CentOS-7 - Base                                                             10.072
centos-sclo-rh/x86_64                   CentOS-7 - SCLo rh                                                           7.863
centos-sclo-sclo/x86_64                 CentOS-7 - SCLo sclo                                                           816
epel/x86_64                             Extra Packages for Enterprise Linux 7 - x86_64                              13.747
extras/7/x86_64                         CentOS-7 - Extras                                                              509
mariadb                                 MariaDB                                                                        101
remi-safe                               Safe Remi's RPM repository for Enterprise Linux 7 - x86_64                   4.707
updates/7/x86_64                        CentOS-7 - Updates                                                           3.726
virtualmin/7/x86_64                     RHEL/CentOS/Scientific 7 - x86_64 - Virtualmin                                 214
virtualmin-universal                    Virtualmin Distribution Neutral Packages                                       238
webtatic/x86_64                         Webtatic Repository EL7 - x86_64                                               789
repolist: 42.988

The following PHP versions are available : 5.4.16 (/bin/php-cgi), 7.3.29 (/opt/rh/rh-php73/root/usr/bin/php-cgi), 7.4.28 (/bin/php74-cgi), 8.0.17 (/bin/php80-cgi), 8.1.4 (/bin/php81-cgi)

The following PHP-FPM versions are available on this system : 7.3.29 (rh-php73-php-fpm) 7.4.28 (php74-php-fpm) 8.0.17 (php80-php-fpm) 8.1.4 (php81-php-fpm)

mmmm I see what happens… I can only have one php-fpm server active at a time, maybe a port issue? I’ll see if I can apply a port to each one to start several of them…

I recommend you disable any repos you are not using. And I recommend not enabling repos unless you know why and know for sure you need it. Third party repos, as mentioned, are much higher risk than the CentOS standard repos. I also recommend only installing the PHP versions you need. Fewer is better, since fewer means you’ve got less to worry about.

Looks like you’ve got PHP 7.3.29 from Software Collections (which I think our installer sets up, so CentOS 7 has a somewhat modern PHP version), and 7.4, 8.0, and 8.1 from probably Remi? (But, I don’t know.) More PHP versions is not better. I’m extremely confident you don’t have any apps that will run on e.g. 7.3 but won’t run on 7.4. Likewise, if something will run on 8.0, it’s also gonna run on 8.1.

Each domain can only have one PHP version for all apps when using PHP-FPM. This is a limitation in Virtualmin at the moment…a little tricky to sort out, but Jamie is working on it. If you must use different versions on the same domain, use suexec+fcgid. But, are you sure? Most PHP apps will run on most reasonably recent PHP versions. Developers are generally trying to make it easy to run their apps.

Yes, I remember the remi repository to update php and is quite used by the whole community, the rest of repositories that I remember are those that came with virtualmin, maybe mariadb that I had to update it compulsorily because with mysql version 5 no longer worked nothing, in short it was just to ask those who know if you see any repo that over … :wink:

Regarding PHP versions, my intention is to leave only one 7.x and one 8.x (except 5.x from Centos), now there are two because I just updated 7.4/8.1 and until I see that everything doesn’t work fine, I won’t remove the old 7.3/8. 0 as a precaution, but the problem is that I can only start one PHP-FPM server for all servers/domains, so if I start PHP-FPM 8.1 I can’t start 7.4, etc… on the other server that I have for testing with AlmaLinux I do have several started and I swear that before it also worked on this server.

Can you think how to fix it? I don’t see how to put a port to each php-fpm server, the PHP 7.3 version that I see is maintained by Centos, I leave it as the 5.x also ???

Thanks

php 8.0x and php 8.1x if developers programming on php version and no more used parts, or newer parts you have to take care.
I know from one shopping system, that step over the 8.0x version so only a version suitable for 8.1x is programmed in develop/beta fase now, not working on 8.0.x.

Definitely not.

We enable EPEL and SCL (and PowerTools on CentOS/RHEL 8) and our own repos (Virtualmin Universal and one for the OS). The default OS repos would have been there before us.

We did not enable mariadb, remi-safe, webtatic, or Webmin. You should not have the Webmin repo configured on a Virtualmin system. The others are up to you, but don’t blame us for them, as we had nothing to do with it.

OK, I understand

mariadb I had to install it as I said before, obligatorily, because virtualmin didn’t update mysql and it stayed in version 5 so for example NextCloud stopped working.
remi-safe a bit for the same reason, it is the only way to have an updated php.
and the other two, the truth is that I don’t even remember what they are for, nor when I installed them, if I deactivate them and do a yum clean it would be ok ???

By the way, I still have the problem that I can only start one php-fpm server service for the whole hosting, if I start 8.1 I can’t start 7.3.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.