Home > Article > Backend Development > What should I do if ubuntu cannot install php5?
ubuntu cannot install php5 because there is no php5 in the official software library of ubuntu16.04 and only comes with php7. The solution is to install 14.04 or use PPA.
The operating environment of this article: ubuntu16.04 system, PHP5 version, DELL G3 computer
Unable to install php5 under ubuntu16.04 Problem Solving
Since the previous project was written in php5, if you want to deploy it on a system upgraded to ubuntu16.04, you must install the php5 version. After running the following command, you will find the following prompt:
lhs@taing:/var/www/html$ sudo apt-get install php5 Reading package lists... Done Building dependency tree Reading state information... Done Package php5 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'php5' has no installation candidate lhs@taing:/var/www/html$ sudo apt-get install libapache2-mod-php5 Reading package lists... Done Building dependency tree... 50% Building dependency tree Reading state information... Done Package libapache2-mod-php5 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'libapache2-mod-php5' has no installation candidate
The reason for this error message is that there is no php5 in the 16.04 official software library, only php7. If you want to install php5, you need to install 14.04 or use PPA.
[Recommended learning: PHP video tutorial]
The above is the detailed content of What should I do if ubuntu cannot install php5?. For more information, please follow other related articles on the PHP Chinese website!