Disable PHP Version

SYSTEM INFORMATION
OS type and version Debian 12.11
Webmin version 2.402
Virtualmin version 7.30.8
Webserver version apache2
Related packages php8.2

Hello, thank you again for this wonderful software. I disabled PHP with:

systemctl disable php8.2-fpm.service

But after rebooting, to my surprise, I found it running. After searching, I found this: PHP-FPM service can be disabled · Issue #644 · virtualmin/virtualmin-gpl · GitHub
and this:
Make sure all FPM versions are enabled at boot https://github.com/vir… · virtualmin/virtualmin-gpl@647a5f6 · GitHub
To permanently disable PHP 8.2, do I need to comment out the code related to this activation in virtual-server-lib-funcs.pl, or is there a way that doesn’t require changing Virtualmin code?

This screen shot is one level down. Find what you want in the menu and click on it. Note at the bottom of that screen you will have the option to disable at boot.

Thank you!
But, the “Start at boot time” option is already marked with “no”. I enabled it here, saved it, then disabled it again and saved it. I hope it works and doesn’t enable itself on the next boot.

Let us know. If it doesn’t work then it would be considered a bug.

Okay, I’ll let you know after the next boot. I just can’t test it now because it’s a production server. Thanks again

1 Like

Why not just remove it, like in the docs on how to install just replace with the remove command
apt-get remove php8.2-{cgi,cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,curl,xml,zip}

1 Like

Yeah, this is a version you installed, it’s not the OS default package (which I generally recommend leaving alone). If you installed it, you don’t need anyone’s permission to remove it. If you don’t want it, just get rid of it. Having a bunch of PHP versions is generally an anti-pattern, it costs resources and requires you to maintain them all and keep up with updates and EOL date.

You should never change the app’s package files like this.

Thanks for everyone’s feedback. Okay, Ilia, that’s why I asked before I made the changes. Joe, it was the Virtualmin installer that installed PHP 8.2 on a fresh Debian 12. I use the CLI a bit, but i simply wanted to disable the service. Stefan1959, thanks for reminding me about the possibility of completely uninstalling.

If the package is named php8.2-*, it was not Virtualmin that installed it.

Joe, when virtualmin tells apt to install php without specifying the version, currently on debian, version 8.2 is being installed, not the latest (8.4) or any other, even after apt update.

OK. Virtualmin installed packages named php-*. If that’s a metapackage that points to php8.2-*, then Virtualmin installed it. I didn’t think that was how Debian laid out their packages, though.