I am using Ubuntu 22.04.1
I am having issues with php version's installation Specially php7.4.

I have tried with these reference but it did't work for me.
https://www.linuxcapable.com/how-to-install-php-7-4-on-ubuntu-20-04-lts/
How can I install php7.4 on Ubuntu 19.04?
https://www.codegrepper.com/code-examples/php/%3A+Unable+to+locate+package+php7.4-fpm
Please help !!! Thanks.
Hit the following commands to install php at any version (replace php7.4 with your required version) in Linux OS:
sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt -y install php7.4
Check PHP Version :
php -v
You may need some other packages to install. You can do so by following the commands :
sudo apt-get install -y php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath
sudo apt install php7.4-fpm
Start FPM and check status :
systemctl restart php7.4-fpm
systemctl status php7.4-fpm
The above-mentioned actions resolved the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With