Score:1

Upgrade PHP and keep extensions and config changes

cn flag

I would like to install PHP 8.2 but keep all the packages and config changes from 8.1

In a perfect world I would run one script an this would work again for 8.3 next year.

Steps:

  • Get all packages/extensions from PHP 8.1
  • Change version to 8.2
  • Install packages
  • Copy config from /etc/php/8.1/{apache2,cli,fpm}/conf.d/*
  • Get a diff with changes in php.ini files, maybe also fpm/pool.d/www.conf

I already got the first step:

sudo dpkg --get-selections | grep -i "php8.1"

I think the step with php.ini is hard. It would be better to have the php.ini unchanged. Instead create a mods-available/custom.ini and activate it with sudo phpenmod custom.

But I think there must be a tool/script for this already...

Score:0
us flag

Assuming you are using a debian based distro I would suggest you install all php related packages without specifying the version. For example, php-mysql instead of php8.1-mysql. This will fallback to the currently supported php version and will automatically be upgraded when this gets bumped (for example from 8.0 to 8.1).

Yes, all specific configuration for any given service/program should be kept inside the corresponding conf.d folder. This way you won't get any "changed file" prompts when upgrading packages and the configurations will (usually) be integrated automatically in the new version.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.