For example, you want to change PHP version from 7.4 to 8.0, steps will be:
- Update defaults for CLI:
sudo update-alternatives --set php /usr/bin/php8.0
sudo update-alternatives --set phar /usr/bin/phar8.0
sudo update-alternatives --set phar.phar /usr/bin/phar.phar8.0
sudo update-alternatives --set phpize /usr/bin/phpize8.0
sudo update-alternatives --set php-config /usr/bin/php-config8.0
- If you use Apache:
sudo a2dismod php7.4
sudo a2enmod php8.0
sudo service apache2 restart
- If you use Nginx:
location ~ \.php$ {
    fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
    ...
}
Popular knowhows
                    pubsub
                    gcloud
                    docker
                3 years ago
    
                    go
                    golang
                    testing
                3 years ago
    
                    ubuntu
                    macos
                    terminal
                    tar
                3 years ago