• Skip to main content
  • Skip to primary sidebar

Web Development Archive

  • Archive
You are here: Home / Other / Downgrade PHP 8.0 to 7.4 Ubuntu Digital Ocean

Downgrade PHP 8.0 to 7.4 Ubuntu Digital Ocean

// Enable PPA for PHP 7.4 in your system and install it.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
 
sudo apt-get install php7.4
sudo apt-get install php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-mysql php7.4-mbstring  php7.4-zip php7.4-fpm php7.4-intl php7.4-simplexml
 
// a2dismod disables the php8.0 module by removing those symlinks.
sudo a2dismod php8.0
 
// a2enmod enables php7.4 module within the apache2 configuration.
sudo a2enmod php7.4
 
// Restart apache2 service.
sudo service apache2 restart  
 
// Set alternative name path.
sudo update-alternatives --set php /usr/bin/php7.4
sudo update-alternatives --set phar /usr/bin/phar7.4
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4
sudo update-alternatives --set phpize /usr/bin/phpize7.4
sudo update-alternatives --set php-config /usr/bin/php-config7.4

Check php version from terminal

php --version

Filed Under: Other

About Gabor Flamich

I'm a web developer and designer based in Budapest, Hungary. In recent years, I've documented hundreds of solutions I came across during development. This site is an archive for useful code snippets on WordPress, Genesis Framework and WooCommerce. If You have any questions related to WordPress development, get in touch!

Primary Sidebar

  • angular.io
© 2026 WP Flames - All Right Reserved