Best selection of PHP extensions

SYSTEM INFORMATION
OS type and version Ubuntu 22.04

Hi

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}

Hello,

Thanks for the heads up!

I’m not sure why you need php-snmp really?

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. :smile:

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.

I was also considering removing php-cgi

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.

Yes, we could do that. But if php-cgi is removed and the php command still exists, I think it can still be used to run scripts in CGI mode!

Can it? Could you please double check that?

Looks like actually no, the php-cgi package is needed! Let me see about dealing with that better …

Ok this will be fixed in the next release …

This might sound really dumb

  • What was broken?
  • What was fixed?

perhaps this ?

@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.

So I am not sure what is broken :frowning:

however virtualmin manages php installations, and this is an alteration to the way that virtualmin manages your php installation

The bug was that Virtualmin assumes that PHP scripts can be run in CGI or fCGI modes even when the php-cgi command is missing.

The fixes are The plain php command can't run in CGI mode · virtualmin/virtualmin-gpl@c383749 · GitHub and Fix fetching of possible PHP modes https://forum.virtualmin.com/t/bes… · virtualmin/virtualmin-gpl@03f2f7b · GitHub

1 Like

Thanks

Just a quicky, on Ubuntu I thought it was the php-fpm module that installed fast CGI, not php-cgi.

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.

1 Like

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