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

SYSTEM INFORMATION
OS type and version Centos 7.9.2009
Webmin version 1.990
Virtualmin version 6.17.pro
Related packages SUGGESTED

Hello, i install PHP 7.4 & 8.1 but i can not start php-fpm server, maybe i missing one command ???
Thank you

Did you install PHP from Multiple PHP Versions – Virtualmin

Did you thereafter yum -y install rh-php74-php-fpm and yum -y install rh-php81-php-fpm

1 Like

Seems like 99% of the time PHP problems are because you installed mod_php. So…if you installed mod_php, you should not have, and you should uninstall it. It breaks all other execution modes (without some extra hoops, and since it is a terrible idea to have it installed, it makes no sense to jump through those hoops, just uninstall the damned thing).

Also, this is not a good post. You did not include actual errors or any log entries. You need to do that, if we have to troubleshoot anything more than “this is what people usually do wrong”.

Yes in install from this link, but when i install yum -y install rh-php74-php-fpm and yum -y install rh-php81-php-fpm i have this output → [root@hosting ~]# yum -y install rh-php81-php-fpm
Complementos cargados:fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirror.tedra.es
  • centos-sclo-rh: mirror.tedra.es
  • centos-sclo-sclo: mirror.tedra.es
  • epel: pkg.adfinis.com
  • extras: mirror.tedra.es
  • remi-safe: remi.schlundtech.de
  • updates: mirror.tedra.es
  • webtatic: uk.repo.webtatic.com
    No existe disponible ningún paquete rh-php81-php-fpm.
    Error: Nada para hacer

I don’t have this packet to install

yum list installed rh-php8* not show me package installed but yes if i check installed php8*

I am sorry, i don’t understand diference betwen rh-php* and php* packages

rh-* packages come from Software Collections.

Thank you Joe, but I still don’t understand how to solve my problem, in my system I do → yum list installed rh-php* only show me rh-php73 packages installed, but i have working PHP-FPM server in 8.0 and 7.3 versions, now i want upgrade this to 8.1 and 7.4 but cannot start this services

I make a search about this, → yum installed mod_php* and i not view anything like this installed

If i list → yum list rh-php* only view packages php70, 71, 72, and php73, not 7.4 or 8.0, 8.1

remi packages do not have the rh- prefix.

It really seems like you didn’t actually follow the docs we provide for this? You’re asking for help doing things that you would have already done, had you followed this guide (choosing 8.1 instead of 8.0 is fine):

https://www.virtualmin.com/documentation/web/multiplephp/

Remi repo provides newer PHP packages than Software Collections, and they do not have an rh- prefix. You’re searching for packages that don’t exist and are not expected to exist (and our docs do not suggest exist).

Since you’re on CentOS 7, this is the specific section of the guide: Multiple PHP Versions – Virtualmin

1 Like

Also, mod_php is in the php package for whatever version you’re installing (e.g. php81-php). Very often when folks follow guides elsewhere on the internet or they venture out on their own, they end up with mod_php installed. You should not do that. mod_php has no place in a modern deployment.

1 Like

I’m sorry Joe for not say after, but this is the guide i follow

This is the output of this commands, i think its all correct but can no start this php-fpm versions ¿??

[root@hosting ~]# yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm && yum clean all
Complementos cargados:fastestmirror
remi-release-7.rpm                                             |  23 kB  00:00:00
Examinando /var/tmp/yum-root-V6EXEd/remi-release-7.rpm: remi-release-7.9-3.el7.remi.noarch
/var/tmp/yum-root-V6EXEd/remi-release-7.rpm: no actualiza el paquete instalado.
Error: Nada para hacer
[root@hosting ~]# yum -y install php74-php-{cli,pdo,fpm,zip,gd,xml,mysqlnd,opcache}
Complementos cargados:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.tedra.es
 * centos-sclo-rh: mirror.tedra.es
 * centos-sclo-sclo: mirror.tedra.es
 * epel: pkg.adfinis.com
 * extras: mirror.tedra.es
 * remi-safe: remi.schlundtech.de
 * updates: mirror.tedra.es
 * webtatic: uk.repo.webtatic.com
El paquete php74-php-cli-7.4.28-1.el7.remi.x86_64 ya se encuentra instalado con su versión más reciente
El paquete php74-php-pdo-7.4.28-1.el7.remi.x86_64 ya se encuentra instalado con su versión más reciente
El paquete php74-php-fpm-7.4.28-1.el7.remi.x86_64 ya se encuentra instalado con su versión más reciente
El paquete php74-php-pecl-zip-1.20.0-1.el7.remi.x86_64 ya se encuentra instalado con su versión más reciente
El paquete php74-php-gd-7.4.28-1.el7.remi.x86_64 ya se encuentra instalado con su versión más reciente
El paquete php74-php-xml-7.4.28-1.el7.remi.x86_64 ya se encuentra instalado con su versión más reciente
El paquete php74-php-mysqlnd-7.4.28-1.el7.remi.x86_64 ya se encuentra instalado con su versión más reciente
El paquete php74-php-opcache-7.4.28-1.el7.remi.x86_64 ya se encuentra instalado con su versión más reciente
Nada para hacer

I think its not installed

[root@hosting ~]# yum list installed mod_php*
Complementos cargados:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.tedra.es
 * centos-sclo-rh: mirror.tedra.es
 * centos-sclo-sclo: mirror.tedra.es
 * epel: pkg.adfinis.com
 * extras: mirror.tedra.es
 * remi-safe: remi.schlundtech.de
 * updates: mirror.tedra.es
 * webtatic: uk.repo.webtatic.com
Error: No hay paquetes que se correspondan con la lista

I told you the name of the mod_php package is php, not mod_php. i.e. php81-php

Sorry, no php74-php, php80-php, etc…

OK, and have you done a Re-Check Configuration since installing new PHP packages?

What’s the PHP versions section of that output look like?

ooooohhhh !!! :frowning:

Your system has 19.44 GiB of memory, which is at or above the Virtualmin recommended minimum of 256 MiB.

BIND DNS server is installed, and the system is configured to use it.

Mail server Postfix is installed and configured.

Postfix can support per-domain outgoing IP addresses, but is not currently configured to do so. This can be setup in the Postfix Mailserver module.

Apache configuration errors were found :

AH00526: Syntax error on line 437 of /etc/httpd/conf/httpd.conf: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration

… your system is not ready for use by Virtualmin.

php_value memory_limit 32M
php_value suhosin.session.encrypt Off
php_value safe_mode Off
php_value magic_quotes_runtime Off
php_value register_globals Off
php_value display_errors Off
php_value max_execution_time 30
php_value file_uploads On
php_value upload_max_filesize 8M
php_value post_max_size 8M
php_value magic_quotes_gpc Off
php_value date.timezone Europe/Madrid
php_value session.auto_start Off
php_value mbstring.func_overload Off
php_admin_value engine Off
Redirect /mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
Redirect /.well-known/autoconfig/mail/config-v1.1.xml /cgi-bin/autoconfig.cgi
FcgidMaxRequestLen xxxx

Houston, houston, we have a problem, big problem … :- (

i try to restart the service and Failed to start service apache, i not have www hosting

Failed to re-start service :

Redirecting to /bin/systemctl start httpd.service Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.

the 438 line fail its only this → php_value memory_limit 32M

Any idea ???

You installed mod_php (very bad!), but then uninstalled it (very good!) or disabled it (OK, not great, might break again on updates).

So, fix your httpd.conf to only use valid syntax. (Anything with php_value is for mod_php, which you are never going to install again, because you’ve learned your lesson.)

it’s my fault :sleepy:

Now what do I do to make it work? edit httpd.conf and remove everything I have with mod_php…* ??

EUREKA !!!

I change all mod_php to # and php_admin_value to ## and now i can start apache, re-check the config and this is the output →

Your system has 19.44 GiB of memory, which is at or above the Virtualmin recommended minimum of 256 MiB.

BIND DNS server is installed, and the system is configured to use it.

Mail server Postfix is installed and configured.

Postfix can support per-domain outgoing IP addresses, but is not currently configured to do so. This can be setup in the Postfix Mailserver module.

Apache is installed.

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)

The following PHP execution modes are available : none cgi fcgid fpm

PHP versions have changed to 5, 7.3, 7.4, 8.0, 8.1 since last check. Regenerating any missing php.ini files.

Now I have php5 installed again, which is perhaps what caused the problem, because when I uninstalled it I must have uninstalled mod_php (well done) and that’s why it stopped working.
Before I touch again and break something… any help/guide to uninstall it? or better I don’t touch it even if it’s insecure/obsolete?

1 Like