I have now got around to deciding what is a good setup of PHP extensions. Can you guys have a look at my selection below and give some some feed back and if I have missed any essentials extensions.
I have used some hosting companie’s PHP setup as a reference and made sure both Joomla and WordPress are fully supported.
## Suitable for Joomla, WordPress (Required + Highly Recommended + Fallback + Cache) and General Hosting
apt-get install php8.1-{cli,cgi,fpm,opcache,common,bcmath,bz2,curl,gd,imagick,imap,intl,ldap,mbstring,mysql,readline,snmp,soap,tidy,xml,xmlrpc,zip}
i was unsure about that one, the reason I added some of them was that they were present on 2 x cpanel setups with 2 different providers. But I think I will remove that.
When I got some feedback I was going to submit some notes to go on the multiple PHP page such as when you install a newer version of PHP (definitely on Ubuntu) that this will alter your system default PHP version.
You could do that, although you won’t be able to run PHP scripts using CGI. PHP-FPM will work though!
@Jamie, can we not show incompatible/not available modes for PHP? For instance, deleting all php*cgi packages on my Ubuntu 22.04 and re-running config check still shows CGI wrapper and FCGId as an option under PHP script execution mode.
@jimr1 For as long I have been on this forum Joe has told us that PHP has nothing to do with Virtualmin. Virtuamin is written in Pearl.
So I was suggestion to remove the php8.1-cgi from the alternative PHP installation script as it should not be used by anyone or hosting websites as it is old and slow.
php-fpm is independent of running PHP apps via fcgid+suexec (which uses php-cgi and predates the existence of php-fpm). FPM is an application server for PHP apps that speaks the FastCGI protocol. FastCGI is a protocol, not any specific implementation, and there are several ways to run Apache+PHP apps using the FastCGI protocol.
You should use FPM, if you can. The implementation is much simpler (from the user perspective), it is much more actively maintained, it is more efficient, etc. And, it provides the same security benefits of suexec.