Linux Debian 11 Bullseye: How To Switch Between Multiple PHP Versions You need to first know what PHP version is running on your computer php -v Disable that version sudo a2dismod php7.2 Enable the version you want to use sudo a2enmod php5.6 Set the version you want as default sudo update-alternatives --set php /usr/bin/php5.6 Alternatively to the last command, you can run the next one to set the default PHP version sudo update-alternatives --config php If you have installed other PHP extensions, set them as default as well sudo update-alternatives --set phar /usr/bin/phar5.6 Finally, restart your Apache sudo systemctl restart apache2 Check your default version php -v