I have multiple PHP versions (8.1/8.2/8.3) installed on my Ubuntu 22.04 system, and I'm trying to switch between them using the sudo update-alternatives --config PHP command. However, I'm facing an issue where the CLI version changes successfully, but the PHP version on my Apache server remains unchanged when I visit my project URL in the browser.
I've attempted various solutions, including:
sudo update-alternatives --set php /usr/bin/php${version}sudo a2dismod php8.1sudo a2enmod php7.2sudo service apache2 restartsudo update-alternatives --set php /usr/bin/php7.2I've also restarted FPM, but none of these solutions seem to work. I'd appreciate any insights into what might be causing this issue and how to resolve it. My operating system is Ubuntu 22.04.
Thank you in advance for your help!