Installing php7.4 on ubuntu 20(aws server) I have php 8 installed.I tried to disable it and enable 7.4.All my output commands below show valid output, but restarting apache I have php8 anyway:
ubuntu@ip-172-31-38-186 : ubuntu :~$ cd /etc/phpubuntu@ip-172-31-38-186 : ubuntu :/etc/php$ ls -latotal 36drwxr-xr-x 9 root root 4096 Jul 22 11:28 .drwxr-xr-x 96 root root 4096 Jul 25 03:59 ..drwxr-xr-x 3 root root 4096 Jul 22 11:28 5.6drwxr-xr-x 3 root root 4096 Jul 22 11:28 7.0drwxr-xr-x 3 root root 4096 Jul 22 11:28 7.1drwxr-xr-x 3 root root 4096 Jul 22 11:28 7.2drwxr-xr-x 3 root root 4096 Jul 22 11:28 7.3drwxr-xr-x 5 root root 4096 Jul 22 11:23 7.4drwxr-xr-x 5 root root 4096 Jul 22 11:28 8.0ubuntu@ip-172-31-38-186 : ubuntu :/etc/php$ uname -aLinux ip-172-31-38-186 5.8.0-1041-aws #43~20.04.1-Ubuntu SMP Thu Jul 15 11:07:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linuxubuntu@ip-172-31-38-186 : ubuntu :/etc/php$ php -vPHP 8.0.8 (cli) (built: Jul 1 2021 15:26:46) ( NTS )Copyright (c) The PHP GroupZend Engine v4.0.8, Copyright (c) Zend Technologies with Zend OPcache v8.0.8, Copyright (c), by Zend Technologiesubuntu@ip-172-31-38-186 : ubuntu :/etc/php$ sudo a2dismod php8.0Module php8.0 already disabledubuntu@ip-172-31-38-186 : ubuntu :/etc/php$ sudo a2dismod php8ERROR: Module php8 does not exist!ubuntu@ip-172-31-38-186 : ubuntu :/etc/php$ sudo a2dismod php8.0.8ERROR: Module php8.0.8 does not exist!ubuntu@ip-172-31-38-186 : ubuntu :/etc/php$ sudo a2enmod php7.4Considering dependency mpm_prefork for php7.4:Considering conflict mpm_event for mpm_prefork:Considering conflict mpm_worker for mpm_prefork:Module mpm_prefork already enabledConsidering conflict php5 for php7.4:Module php7.4 already enabledubuntu@ip-172-31-38-186 : ubuntu :/etc/php$ sudo service apache2 restartubuntu@ip-172-31-38-186 : ubuntu :/etc/php$ php -vPHP 8.0.8 (cli) (built: Jul 1 2021 15:26:46) ( NTS )Copyright (c) The PHP GroupZend Engine v4.0.8, Copyright (c) Zend Technologies with Zend OPcache v8.0.8, Copyright (c), by Zend Technologies
restarting OS did not help.How to setup php 7.4 ?
Thanks!