. Advertisement .
..3..
. Advertisement .
..4..
A lot of you might be getting the error “Couldn’t find any package by glob ‘php7.4’” while running composer update. The composer has been a very reliable tool for several years. However, the composer recently ran into a major issue that has broken several millions of composer installs. Check out the blog to fix this issue and update your composer.
When dose the error happen?
When installing php in my ubuntu 16.04 for Apache2 server But you run php -v command you found the warning message. On the other hand, adding the ppa ondrej/php
, you try sudo apt-get install php7.4
Here is the warning text you face it
Reading package lists… Done
Building dependency tree
Reading state information… Done
Unable to locate package php7.4
Couldn’t find any package by glob ‘php7.4’
Couldn’t find any package by regex ‘php7.4’
If you’re using Ondrej PPA to install PHP, it only works with Ubuntu 21.04, 20.10, 20.04, and 18.04. You’re using Ubuntu 16.04, which is outdated, so the long-term workaround is to upgrade to Ubuntu 18.04 or 21.04. Click the below part to find the simple and effective solutions for this problem
How To Fix The Error “Couldn’t find any package by glob ‘php7.4’”?
Option 1: Install php by utilizing 3rd party repository
If you’re using Ondrej PPA to install PHP, it only works with Ubuntu 21.04, 20.10, 20.04, and 18.04. You’re using Ubuntu 16.04, which is outdated, so the long-term workaround is to upgrade to Ubuntu 18.04 or 21.04. You can archive this for the time being by adding this 3rd party repository to the system. Simply execute these two commands:
sudo add-apt-repository ppa:jczaplicki/xenial-php74-temp
sudo apt-get update
Then, run the php -v command. Your problem should now be resolved.
Option 2: Utilize the following repo
sudo add-apt-repository ppa:tomvlk/php-archive
sudo apt-get update
Conclusion
We hope you found our article on fixing the error “Couldn’t find any package by glob ‘php7.4’” useful. We understand that dealing with this can be confusing, therefore we hope that our information has assisted you in resolving it. Please leave a comment if you have any further questions or concerns. Thank you for taking the time to read; we are always delighted anytime one of our pieces can give important information on a topic like this!
Leave a comment