Latest version of WordPress requires PHP 8.0+.
Install PHP 8.2 and common modules
$ sudo apt install php8.2-cli php8.2-fpm php8.2-opcache php8.2-curl php8.2-mbstring php8.2-pgsql php8.2-zip php8.2-xml php8.2-gd
$ sudo a2enmod proxy_fcgi setenvif
$ sudo a2enconf php8.2-fpm
$ sudo systemctl reload apache2
# SystemError: One of the required function to build numpy is not available (the list is ['sin', 'cos', 'tan',.....
$ MATHLIB="m" pip3 install numpy