Couldn't find any package by glob 'php-7.4'
Olivia Owen
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.
How can I install php7.4 on Ubuntu 19.04?
Please help !!! Thanks.
42 Answers
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 Still You are Facing below Error (Then Try tricky solution) its not official but worked for me.
Error: Unable to locate package php7.4
Scenario: I was using Ubuntu 20 in azure after trying all documents and efforts but couldn't install PHP.
Solution: I just replaced /etc/apt/source.list file content with fresh Ubuntu 20 /etc/apt/source.list file content and then It worked :-)
ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobmxvaGt%2FeH6OnmScp6Whsa%2FAjJ%2Bgp5xdlru6ec%2BamqSZl5p6o8WMoKOoml2ltbF5lmZr