Configuring a Joomla 4.1.3 server on Ubuntu Desktop 22.04 LTS
First things first. Joomla 4.1.3 works fine on Ubuntu Desktop 22.04 LTS. It just needs a little configuration, especially if you've come from a distribution upgrade and perhaps a different version of PHP. There are some dependencies which need to be resolved and they were quite complex so I wrote it down in case it needed to do it again or it was useful to someone.
TL:DR — Ubuntu 22.04 LTS is PHP 8.1 by default, Joomla 4.1.3 supports PHP 8.1. You may need to configure things to make it work.
After upgrading to Ubuntu 22.04 LTS My Joomla server on my localhost displayed a white screen. Not too good. White screens with Joomla often point to issues with PHP so I started there. This is my development and test server so I was worried it could be a serious issue, but I've just updated to Ubuntu 22.04 LTS so I started there with the differences. The most obvious difference is PHP 8.1. JoomlA support for PHP 8.1 was added in Joomla 4.0.5 https://github.com/joomla/joomla-cms/pull/36041 but my development laptop Joomla installation has lagged a little.
PHP 8.1 is part of Ubuntu 22.04
PHP 7.4 and 8.1 were installed already on my computer, because I had previously set up a Joomla Server, so the distribution upgrade updated it to 8.1. PHP 8.1 no longer requires a third party repository in Ubuntu 22.04. It is part of the release. You only need a third party repository if you need previous releases. If it was not installed you can get it with sudo apt install php8.1.
Fixing my Joomla 4.x dev server PHP 8.1 extensions
Fixing my Joomla was a two part operation. Firstly I needed to ensure my PHP extensions were correct for this new version of PHP. The default installation of PHP 8.1 didn't have everything I had before So I decided I needed to add the missing ones for Joomla. I couldn't find a comprehensive list so I just compared old and new and came up with the list sudo apt instal php8.1-gd php8.1-intl php8.1-mbstring php8.1-mysqli php8.1-mysqlnd php8.1-tidy php8.1-xmlreader php8.1-xmlrpc php8.1-zipOnce installed my 8.1/mods-available directory I'd like to say Joomla came to life but it did not - there was another step for me. Anyway here is my mods-available directory, as you can see its now very similar between PHP 7.4 and PHP 8.1.
% ls /etc/php/7.4/mods-available
calendar.ini ffi.ini iconv.ini mysqlnd.ini posix.ini sysvmsg.ini xdebug.ini.dpkg-bak xsl.ini
ctype.ini fileinfo.ini intl.ini opcache.ini readline.ini sysvsem.ini xml.ini zip.ini
curl.ini ftp.ini json.ini pdo.ini shmop.ini sysvshm.ini xmlreader.ini
dom.ini gd.ini mbstring.ini pdo_mysql.ini simplexml.ini tidy.ini xmlrpc.ini
exif.ini gettext.ini mysqli.ini phar.ini sockets.ini tokenizer.ini xmlwriter.ini
% ls /etc/php/8.1/mods-available
calendar.ini ffi.ini iconv.ini opcache.ini readline.ini sysvsem.ini xml.ini zip.ini
ctype.ini fileinfo.ini intl.ini pdo.ini shmop.ini sysvshm.ini xmlreader.ini
curl.ini ftp.ini mbstring.ini pdo_mysql.ini simplexml.ini tidy.ini xmlrpc.ini
dom.ini gd.ini mysqli.ini phar.ini sockets.ini tokenizer.ini xmlwriter.ini
exif.ini gettext.ini mysqlnd.ini posix.ini sysvmsg.ini xdebug.ini xsl.ini
Updating Joomla 4.x itself for PHP 8.1 compatibility
The second part could have been tricky on a hosted server but was easy on my Ubuntu Desktop which is a laptop. My original Joomla 4 was too old to support PHP 8.1. This is probably why I had PHP 7.4 on here in the first place. I downloaded an incremental update from Joomla and unzipped it over my existing installation.Now, finally Joomla 4.1.3 loaded. Its fast, it is totally current, and theres no need for this machine to be on older versions of anything than those supplied as part of the distribution.