install php 8.0

sudo apt-get install apache2 php libapache2-mod-php php-mysql -y;
sudo add-apt-repository ppa:ondrej/php; sudo apt-get update -y;

sudo apt-get dist-upgrade -y;

sudo apt install php8.0-cli libapache2-mod-php8.0 php8.0-fpm php8.0-pdo php8.0-mysql php8.0-zip php8.0-gd  php8.0-mbstring php8.0-curl php8.0-xml php8.0-bcmath php8.0-imagick -y;
sudo apt install php8.0 php8.0-common php8.0-mbstring php8.0-gd php8.0-xml php8.0-intl php8.0-cli php8.0-curl -y;
sudo apt install php8.0-cli php8.0-fpm php8.0-cgi php8.0-pdo php8.0-mysql php8.0-zip php8.0-gd  php8.0-mbstring php8.0-curl php8.0-xml php8.0-bcmath php8.0-imagick -y

----------------------------------------------EDIT THE php.ini FILES FOR PHP 8.0 -------------


#CHANGE FROM 128M
memory_limit = 256M
#CHANGE FROM 60 or 30 to 120
max_input_time = 120
#CHANGE FROM 30 to 90
max_execution_time = 90
#CHANGE FROM 8M to 224M (allows uploading large video files for example)
post_max_size = 224M
#CHANGE FROM 2M to 224M
upload_max_filesize = 224M
#CHANGE FROM 20 to 40
max_file_uploads = 40
#CHANGE FROM 30 to 120
default_socket_timeout = 120

increase max_input_vars for php.ini everything from default 1000 to 20000

vi php/8.0/apache2/php.ini
vi php/8.0/cgi/php.ini
vi php/8.0/cli/php.ini
vi php/8.0/fpm/php.ini
-----------------------------------------------FINISH EDITING THE php.ini FILE FOR PHP 8.0 ----

 

To switch PHP versions on the command line:

sudo update-alternatives --config php

There are 4 php alternatives (to supply /usr/bin/php).

  Selection   Path                Priority  State
------------------------------------------------------------
  0            /usr/bin/php.default   100       mode automatique
  1            /usr/bin/php.default   100       mode manuel
* 2            /usr/bin/php7.4        74        mode manuel
  3            /usr/bin/php8.0        80        mode manuel
  4            /usr/bin/php8.1        81        mode manuel

Hit <Enter> to keep the default [*] or choose the number :