{"id":9606,"date":"2022-11-16T17:30:14","date_gmt":"2022-11-16T17:30:14","guid":{"rendered":"https:\/\/stevepedwards.today\/DebianAdmin\/?p=9606"},"modified":"2022-11-26T18:28:21","modified_gmt":"2022-11-26T18:28:21","slug":"downgrading-php-versions","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/DebianAdmin\/downgrading-php-versions\/","title":{"rendered":"Downgrading PHP Versions"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_9606\" class=\"pvc_stats all  \" data-element-id=\"9606\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p><a href=\"https:\/\/medium.com\/@skounis\/downgrade-php8-1-to-php8-0-or-php7-4-on-ubuntu-22-04-2fab4a6a3be3\">Downgrade PHP8.1 to PHP8.0 or PHP7.4 on Ubuntu 22.04<\/a> | by Stavros Kounis | Medium<\/p>\n<p>Ubuntu 22.04 comes with PHP 8.1. This article describes how to change this and install and set as default the version 8.0 or 7.4.<\/p>\n<p>Install PHP Version<br \/>\nInstall the required dependencies.<\/p>\n<p><span style=\"color: #0000ff;\">sudo apt install software-properties-common ca-certificates lsb-release apt-transport-http<\/span><br \/>\nAdd the required PPA<\/p>\n<p>LC_ALL=C.UTF-8<\/p>\n<p><span style=\"color: #0000ff;\">sudo add-apt-repository ppa:ondrej\/php<\/span><\/p>\n<p>Update the Apt package manager<\/p>\n<p><span style=\"color: #0000ff;\">sudo apt update<\/span><br \/>\nInstall PHP 8.0 and all the PHP modules.<\/p>\n<p><span style=\"color: #0000ff;\">sudo apt install php8.0<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo apt install php8.0-mysql php8.0-mbstring php8.0-xml php8.0-curl php8.0-gd<\/span><\/p>\n<p>Switch PHP versions and enable PHP 8.0<br \/>\nSet 8.09 as the default PHP version for CLI and Apache.<\/p>\n<p>Command Line PHP:<br \/>\n<span style=\"color: #0000ff;\">sudo update-alternatives --config php<\/span><br \/>\nSelect php8.0 from the list with the available options:<\/p>\n<p>There are 2 choices for the alternative php (providing \/usr\/bin\/php).<br \/>\nSelection Path Priority Status<br \/>\n------------------------------------------------------------<br \/>\n<span style=\"color: #ff0000;\">0 \/usr\/bin\/php8.1 81 auto mode<\/span><br \/>\n<span style=\"color: #ff0000;\">* 1 \/usr\/bin\/php8.0 80 manual mode<\/span><br \/>\n<span style=\"color: #ff0000;\">2 \/usr\/bin\/php8.1 81 manual mode<\/span><br \/>\n<span style=\"color: #ff0000;\">Press &lt;enter&gt; to keep the current choice[*], or type selection number:<\/span><br \/>\nApache PHP<br \/>\nDisable PHP 8.1<\/p>\n<p><span style=\"color: #0000ff;\">sudo a2dismod php8.1<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo service apache2 restart <\/span><\/p>\n<p>Enable PHP 8.0<\/p>\n<p><span style=\"color: #0000ff;\">sudo a2enmod php8.0 <\/span><br \/>\n<span style=\"color: #0000ff;\">sudo service apache2 restart<\/span><\/p>\n<p>Verify PHP Version<br \/>\n<span style=\"color: #0000ff;\">php -v<\/span><\/p>\n<p><span style=\"color: #ff0000;\">PHP 8.0.18 (cli) (built: May 1 2022 04:42:09) ( NTS )<\/span><br \/>\n<span style=\"color: #ff0000;\">Copyright (c) The PHP Group<\/span><br \/>\n<span style=\"color: #ff0000;\">Zend Engine v4.0.18, Copyright (c) Zend Technologies<\/span><br \/>\n<span style=\"color: #ff0000;\">with Zend OPcache v8.0.18, Copyright (c), by Zend Technologies<\/span><br \/>\n<span style=\"color: #ff0000;\">For verifying the PHP version Apache uses, specify the configururation .ini file.<\/span><\/p>\n<p><span style=\"color: #0000ff;\">php -c \/etc\/php\/apache2\/php.ini -v<\/span><\/p>\n<p>Depending which version you chose and if the mysql extension is installed or not;<\/p>\n<p>If you see:<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\"Your PHP installation appears to be missing the MySQL extension which is required by WordPress.\"<\/strong><\/span><\/p>\n<p><span style=\"color: #0000ff;\">apt-get install php7.4-mysql<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_9606\" class=\"pvc_stats all  \" data-element-id=\"9606\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>Downgrade PHP8.1 to PHP8.0 or PHP7.4 on Ubuntu 22.04 | by Stavros Kounis | Medium Ubuntu 22.04 comes with PHP 8.1. This article describes how to change this and install and set as default the version 8.0 or 7.4. Install PHP Version Install the required dependencies. sudo apt install software-properties-common ca-certificates lsb-release apt-transport-http Add the <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/downgrading-php-versions\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 Downgrading PHP Versions<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-9606","post","type-post","status-publish","format-standard","hentry","category-post"],"a3_pvc":{"activated":true,"total_views":24,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/9606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=9606"}],"version-history":[{"count":4,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/9606\/revisions"}],"predecessor-version":[{"id":9806,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/9606\/revisions\/9806"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=9606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/categories?post=9606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/tags?post=9606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}