Errror after install php 8.1 on ubuntu

OS type and version Ubuntu Linux 22.04.4
Webmin version 2.105
Usermin version 2.005
Virtualmin version 7.10.0
Theme version 21.09.5
Package updates 1 package update is available

when i add php 8.1 to my server ai receive this:

[master 621af1ba] saving uncommitted changes in /etc prior to apt run
Author: diego
3 files changed, 1 insertion(+), 2 deletions(-)
Setting up php8.1-fpm ( …
NOTICE: Not enabling PHP 8.1 FPM by default.
NOTICE: To enable PHP 8.1 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php8.1-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Job for php8.1-fpm.service failed because the control process exited with error code.
See “systemctl status php8.1-fpm.service” and “journalctl -xeu php8.1-fpm.service” for details.
invoke-rc.d: initscript php8.1-fpm, action “restart” failed.
× php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php8.1-fpm.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2024-04-05 16:40:44 UTC; 4ms ago
Docs: man:php-fpm8.1(8)
Process: 17401 ExecStart=/usr/sbin/php-fpm8.1 --nodaemonize --fpm-config /etc/php/8.1/fpm/php-fpm.conf (code=exited, status=78)
Process: 17402 ExecStopPost=/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/8.1/fpm/pool.d/www.conf 81 (code=exited, status=0/SUCCESS)
Main PID: 17401 (code=exited, status=78)
CPU: 38ms

Apr 05 16:40:44 systemd[1]: Starting The PHP 8.1 FastCGI Process Manager…
Apr 05 16:40:44 www.vixxxxxxcom php-fpm8.1[17401]: [05-Apr-2024 16:40:44] ERROR: [pool 167398695354410] cannot get uid for user ‘server’
Apr 05 16:40:44 php-fpm8.1[17401]: [05-Apr-2024 16:40:44] ERROR: FPM initialization failed
Apr 05 16:40:44 systemd[1]: php8.1-fpm.service: Main process exited, code=exited, status=78/CONFIG
Apr 05 16:40:44 systemd[1]: php8.1-fpm.service: Failed with result ‘exit-code’.
Apr 05 16:40:44 systemd[1]: Failed to start The PHP 8.1 FastCGI Process Manager.
dpkg: error processing package php8.1-fpm (–configure):
installed php8.1-fpm package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

i read othe cases in support, but i canot find a solution forr this, plase help
actualy i have several version of php inslalled a long time ago w/o problem, but i need 8.1 for make a drupal update ( a long story)
tx in advacne

Did you follow the documentation?

yes, i did, actually, i receive this error in the second step:

On Ubuntu

  1. Enable Ondrej/PHP repository
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && apt-get update
  1. Install PHP packages
apt-get install php8.1-{cgi,cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,curl,xml,zip}    <-------------------------- this 
  • Replace php8.1 with the specific version, e.g., php8.3.
  • Check available PHP versions and extensions on the Ondrej PPA website or via apt-cache search --names-only ^php.

PHP 8.1 is the version that comes with Ubuntu 22 repository. If you have installed Virtualmin then this should have been installed already for you. No need to add another repository. So you could now have 2 conflicting versions of PHP 8.1.

yes you are right, i remember it. 8.1 must to work, but it wont work
any idea how to fix it?

Ensure that all necessary PHP modules are installed and enabled for PHP 8.1. Some modules might be different between PHP versions, so it’s important to install the correct ones. You can use php -m to list enabled modules.

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