sudo apt install -y php7.4-cli php7.4-dev php7.4-pgsql php7.4-sqlite3 php7.4-gd php7.4-curl php7.4-memcached php7.4-imap php7.4-mysql php7.4-mbstring php7.4-xml php7.4-imagick php7.4-zip php7.4-bcmath php7.4-soap php7.4-intl php7.4-readline php7.4-common php7.4-pspell php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-opcache php7.4-apcu
1. Open xampp site https://www.apachefriends.org/
2. Click on download other versions > Select more version
3. Download your the version you want in zip format (and un zip)
4. Stop xampp (apachi and mysql) and Go to your old xampp
5. rename apachi folder and php folder and copy only these two folders from unzip folder
6. open new php folder > open php.ini file in editer
7. search: extension_dir = "xamppphpext"
8. replace: extension_dir = "C:xamppphpext"
9. start your xampp and check php -v